I am working on an APEX application where i basically need to make some particular cells of a column read-only based on some condition during the page load. Lets say a column accepting date values. I tried using the ReadOnly attribute to do so by using the PL/SQL expression and PL/SQL function body as the options but i am not clear of the format it expects me to use. Is it possible to do it this way? If yes, then how should i proceed with it?
I also saw a way to access the cells independently through Javascript and iterate on the cells later using this...
var view$ = apex.region("----").widget().interactiveGrid("getViews").grid.view$;
where "----" is the region id. How can i find my region id if this could be one possible solution?
To make the region ID predictable, set a Static ID in the region properties.
Related
I want to save a specific value that is on a specific row and column. How I can do this? I already search, but I didn't find anything
One doesn't save a value from the grid but rather from the underlying dataset. The following is for Delphi, but I understand that Lazarus is near enough the same. Let's say that the grid is displaying data from a query qTest that has fields id, surname, forename, date of birth (DOB). In Delphi, one can automatically have variables created with names qTestID, qTestSurname, etc. Another way of referring to the variables is by use of the 'fieldbyname' syntax - qTest.fieldbyname ('surname').asstring.
Write a dblClick handler for the grid: when one gets to the row that holds the required data, perform a double click. In the handler, the fields of the row will now be available as qTestID.asinteger, qTestSurname.asstring, etc.
I am currently trying to add a feature to an existing Oracle Apex application (Apex). I have already looked around on here and found a few guides but none are helping me specifically with this subject and as I am a complete newbie to Oracle Apex, I am asking this question and thankful for any help:
how can I cross-conditionally color format the text of a text-field returned to the user (see link below) based on another item on the page? More or less like a succes/failure-message.
highlighted succes/failure-message-text
The content from the success/failure-message is returned from a stored procedure, which is run after the user scans a barcode for input (:P1_CANN, text field, label: 'Scanneingabe'). After running, the stored procedure returns two values: the content of the success/failure-message (:P1_CANNBACK, display only page item) and a value 1/0 for scan/failure of the scan (:P1_CSS,hidden page item). Based on the value returned from :P1_CSS I would like to color the text of the success/failure-message correspondingly, for instance to green if the returned value is 1 and red if it is 0.
I am using Oracle 12c as the database. The stored procedure runs a short PL/SQL-Code:
*#OWNER#.DOMENICO_SCANN_ENT(PSCANN => :P1_CANN, pr => :P1_CANNBACK, pr1 => :P1_CSS);*.
This can be achieved using css. There are different ways you can implement this. One way is this:
Create a page item to contain the class name, eg P1_CANNBACK_CLASS
Create a computation to set the value of P1_CANNBACK_CLASS after you have called your stored procedure. PL/SQL code would be something like
CASE :P1_CANN WHEN 1 THEN 'u-success-text' WHEN 0 THEN 'u-danger-text' END
On Page Item P1_CANNBACK, set the css class to &P1_CANNBACK_CLASS.
Note that I used the apex provided css classes (documented here: https://apex.oracle.com/pls/apex/apex_pm/r/ut/color-and-status-modifiers). You can use your style, but then you'll have to define the css classes in the page properties or in a static file. I tested this on a 20.2 instance.
I would like to know if there is a way to sort some data based on the checkbox in Google Spreadsheet. Is there any specific function which can sort based on if statement or script needs to be created?
Each group has a Group Done and checkbox for it below it. The idea is to once you press the checkbox, it would sort out the group based on P (Position). Not sure exactly how to create it.
If the script is needed I was already doing once automatic sorting with onEdit() function, but it was a simple one for just one table or one set of Data. Is it possible to do it based on the reference value of the TRUE statement in the sheet and if it finds it, create the box of values from that position and sort it out?
I want to check certain objects against each other and identify if they are the same.
For example, I need to verify that the total cost in one page is the same as another page. I developed a script that works, however the total cost changes every day so I have to update the object properties in maintenance mode every day.
Is there a way that UFT automatically recognizes this object must change and update?
I request you to elaborate your question. For now, you can use .* if certain values of the object are changing. Alternatively, you can store the values in an excel sheet and you can change everyday depending on the requirement.
If this is not helpful let me know
It sounds like you actually want to compare the values shown in two different objects, and see if those values are the same. (I assume this because you say they are on two different pages)
Also, you mention maintenance mode, so I assume you are using checkpoints to store their expected values.
I would suggest: instead of storing the expected values in a checkpoint, you could read the value of the first object (getROproperty), store it in a variable (dataTable field, environment variable, etc), and then navigate to the other page, read the ROproperty from the other object, and then compare.
i.e.
if {browser,page,object...}.getROproperty({whateverPropertyYouNeed}) = environment({storedFirstValue}) then
reporter.reportevent micPass,"compare step","{details here}"
end if
*replace stuff inside {} with your code, I don't know what it is
If you need to actually store the total cost externally, you could use a DataTable field and export the sheets at the end. then import the same sheet at the beginning. That would save the data to an excel sheet on a drive.
I have a report that is listing students and I want a column to edit a student. I've done so by following this answer:
How do you add an edit button to each row in a report in Oracle APEX?
However, I can only seem to pass 3 items and there's no option to add more. I took a screenshot to explain more:
I need to pass 8 values, how can I do that?
Thanks!
Normally, for this you would only pass the Primary Key columns (here looks like #RECORD_NUMBER# only). The page that you send the person to would then load the form based on the primary key lookup only. If multiple users were using this application, you would want the edit form to always retrieve the current values of the database, not what happened to be on the screen when a particular person ran a certain report.
Change the Target type to URL.
Apex will format what to already have into a URL text field which magically appears between Tem3 and Page Checksum.
All you need to do is to add your new items and values in the appropriate places in the URL.
I found a workaround, at least it was useful to my scenario.
I have an IR page, query returns 4 columns, lets say: ID, DESCRIPTION, SOME_NUMBER,SOME_NUMBER2.
ID NUMBER(9), DESCRIPTION VARCHAR2(30), SOME_NUMBER NUMBER(1), SOME_NUMBER2 NUMBER(3).
What I did was, to setup items this way:
P11_ITEM1-->#ID#
P11_ITEM2-->#DESCRIPTION#
P11_ITEM3-->#SOME_NUMBER##SOME_NUMBER2#
Previous data have been sent to page 11.
In page 11, all items are display only items.
And P11_ITEM3 actually received two concatenated values.
For example, the calling page has columns SOME_NUMER=4 and SOME_NUMBER2=150
so, in pag1 11, P11_ITEM3 shows 4150
In page 11 I created a Before Footer process (pl/sql expression)
to set up new items, for example P11_N1 as source SUBSTR(P11_ITEM3,1,1)
and item P11_N2 as source SUBSTR(P11_ITEM3,2,3)
So, I had those items with corresponding values from the calling IR page.
The reason I did not pass the primary key only for new lookup access, is because i do not want to stress database performing new queries since all data are already loaded into page items. I've been an oracle DBA for twenty years and I know there is no need to re execute queries if you already have the information somewhere else.
These workarounds are not very useful for a product that bills itself as a RAD tool.
Just include a single quoted word in the select statement (Select col1, 'Randomword', col2 from table 1;)
Then define that column as a link and bingo! More items than 3 to select.