I'm creating a form in apex where I want to populate a text box with a value which has been selected in a drop down box. This needs to be done using a select statement on the form.
I have tried using a Dynamic action.
If I was using SQL I would pass the value of the id which I have retrieved using a combo box.
SELECT APPLICATION_ID FROM APPLICATIONS WHERE JOBID = :P55_JOBID
this would update my APEX field (P55_APP_ID)
P55_JOBID is the Job ID APEX field.
The Select statement for APP_ID works but I want it to be updated when the Job Dropdown list changes. I've been told to use a Dynamic action but I cant work out how it triggers a refresh of App_ID..
thanks for your help,
mike
Thanks for your help.
You want a dynamic action that is triggered on the Change event of the select list (P55_JOBID). The action of this will be Set Value and the Set Type will be SQL Statement. Add your SQL (SELECT APPLICATION_ID FROM APPLICATIONS WHERE JOBID = :P55_JOBID) here and then under Page Items to Submit include your select list (P55_JOBID).
The Selection Type will be Item(s) and the Item(s) will be your text area (P55_APP_ID).
Related
Im not sure if this is possible or not in Oracle Apex. Essentially what we have is a textbox field on the opportunity form where folks can put in some free form notes about the opp. I'm looking to see if there is a way to have the current date populate into the text field when the user clicks into the field to add some notes.
Please Advise,
Thanks
Suppose item's name is P36_TEXT. Create dynamic action
Event: Mouse button press
selection type: item
item: P36_TEXT
True action:
execute server-side code
language: PL/SQL
code:
:P36_TEXT := to_char(sysdate, 'dd.mm.yyyy hh24:mi:ss');
items to return: P36_TEXT
That's it; run the page. When you click into that item, dynamic action will populate it with current date/time.
Tested on apex.oracle.com, running Apex 20.2.
Is there a good visual tutorial that takes through the various steps on how to create radio buttons in Apex 19.2? This tutorial Creating a Classic Report having radio button on each row helped me and I’m looking for a similar one..
In my case, I would like to add a radio button to each row of my classic report which when selected would add some of the informations selected by the radio button in a text field in the same page.
Any advice is much appreciated.
Thank you
Install Sample Reporting application on your APEX instance (preferably on apex.oracle.com as Dan suggested).
Navigate to the Classic Report page.
Change the query to the report to the following:
select rowid,
ID,
PROJECT,
TASK_NAME,
START_DATE,
END_DATE,
STATUS,
ASSIGNED_TO,
COST,
BUDGET,
apex_item.radiogroup(1,TASK_NAME) ACTION
from EBA_DEMO_IR_PROJECTS
where (nvl(:P3_STATUS,'0') = '0' or :P3_STATUS = status)
Note the added column "ACTION" which consists of the apex_item.radiogroup with TASK_NAME value. Let's assume that this is the value that you want to pass to another page item.
Open that column's attribute under Page Designer and disable "Escape special characters" attribute and add a CSS Class (e.g. mycolumn)
Create a Page Item (e.g. P3_NEW).
Now add the following Dynamic Action
Event > Click
Selection Type > jQuery Selector
jQuery Selector > #classic_report .mycolumn input
Your true action will be of the type Set Value and the Set Type is JavaScript Expression with the following code:
this.triggeringElement.value
Your affected element is P3_NEW and disable Fire on Initialization
I have a form that contains a select list (:P10_DROPDOWN) that has its values defined via SQL:
SELECT
display_name,
value_id
FROM
vw_dropdown_options;
As a pre-render-before-header-process I have the following PL/SQL to pre-populate :P10_DROPDOWN:
begin
SELECT value_id
INTO :P10_DROPDOWN
FROM vw_dropdown_option_mapping
WHERE vw_dropdown_option_mapping_id = :P10_DROPDOWN_OPTION_MAPPING_ID;
end;
At this point my form appears on my page, and everything looks okay. However I need to have a custom procedure fire when a user clicks a button, so on a button on my page I defined an onClick event to fire this pl/sql block:
APEX_DEBUG.INFO ('P10_DROPDOWN_OPTION_MAPPING_ID ' || :10_DROPDOWN_OPTION_MAPPING_ID);
APEX_DEBUG.INFO ('P10_DROPDOWN ' || :P10_DROPDOWN);
NP_SAVE_MAPPING_VALUE (
DROPDOWN_OPTION_MAPPING_ID => :P10_DROPDOWN_OPTION_MAPPING_ID,
NEW_DROPDOWN_VALUE_ID => :P10_DROPDOWN
);
This is where I first notice my issue; the value logged out by the onClick for :P10_DROPDOWN is what was originally set via my pre-render-before-header-process, and not the value I select via my drop-down.
I have tried setting the source.used value on my dropdown to both "Always" and "Only". I have also replaced my pre-render-before-header-process with a source based single value SQL query. Neither is allowing my dropdown to change the session value via the dropdown.
Am I missing something about these session values?
I suspect that this is because newly selected value isn't in session state. To test it, create a SUBMIT button, push it, and then check the result again.
Just asking: did you consider
setting item's default value (instead of writing a process to pre-populate it)
using a dynamic action (instead of creating an onClick event)
I need to implement a simple product form from a block of data called "PRODUCTS".
The products are related to a "Partner" through the field "COMPANIES_PARTNERS_ID".
This field will be represented by an LOV to select the Partner for which we want to visualize your products.
If there is not a partner currently selected, all your products should be displayed. And when a partner is selected, only their products should be displayed.
The form will look like this:
The button to the right of the search field should show the LOV and launch the query. I tried the following code as a "Smart Trigger" when I pressed the button. But it does not work well at all. The LOV list appears twice and when no partner is selected, no product appears.
Could someone help me to implement this functionality? Thank you
You don't need to use ENTER_QUERY command.
had better using DEFAULT_WHERE set with respect to COMPANIES_PARTNERS_ID. If not selected any of the rows of LOV by pressing CANCEL or dissmissing by X sign, then all of the products will be listed(In this case you'll see the first ID, most probably with value 1, since COMPANIES_PARTNERS_ID is not located at a CONTROL block but at the same block,namely PRODUCTS, with other items. As you go down by down-arrow you'll see the other ID values when your cursor is in COMPANIES_PARTNERS_ID field, seems that Number Of Items Displayed is set to 1 for this field, because PRODUCTS block has been set as 10 items displayed ).
So, you may use the following code in WHEN-BUTTON-PRESSED trigger :
DECLARE
V_WHERE VARCHAR2(500);
BEGIN
GO_ITEM('COMPANIES_PARTNERS_ID');
IF SHOW_LOV('COMPANIES_LOV') THEN
V_WHERE:='COMPANIES_PARTNERS_ID='||:COMPANIES_PARTNERS_ID;
ELSE
V_WHERE:='1=1';
END IF;
SET_BLOCK_PROPERTY('PRODUCTS',DEFAULT_WHERE,V_WHERE);
CLEAR_BLOCK(NO_VALIDATE);
EXECUTE_QUERY;
END;
Once you enter query mode (which is what ENTER_QUERY does), further processing is stopped until you execute query.
I presume that you created a LoV properly - the most usual way is to create a Record Group query first, and then create a LoV based on it.
Therefore, I'd ENTER_QUERY in WHEN-NEW-FORM-INSTANCE trigger and let your current push button display LoV and let user select a value into the "Companies Partners ID" item. Executing a query (either by pressing the corresponding toolbar button, shortcut key (F8?) or your new "Execute query" button) would then actually execute query. If master-detail relationship is properly created (using the Data Block wizard is the simplest option), then you'd get rows in the "Products" block.
Put a value in PRODUCTS block WHERE clause' property.
WHERE CLAUSE property:
COMPANIES_PARTNERS_ID LIKE NVL(:lov_block.COMPANIES_PARTNERS_ID, '%')
I am working in Oracle APEX(Application Express). When I want to create a List of Values (LOV) it gives me only one option for displaying and returning value. Is there any method in APEX so that it can Display me more than one column.
No, there is no way to display more than 1 column by default.
You could alter your lov query to concatenate multiple column values into a display columns
select empno return_value, empno||': '||ename||' - '||job display_value
from emp
You can steer markup through the Popup LOV template too, if you'd want to use a fixed width font.
Use a plugin such as the SkillBuilders SuperLov. However, this plugin does not work in tabular forms.
Roll your own by using for example modal pages (again, SkillBuilders have an excellent plugin for modal pages), or through the use of javascript (ex creating new windows and handling returns)