tags:

views:

417

answers:

2

I'm using Application Express 4.0.0.00.25 ( Apex 4.0 EA2 ). I've created a simple form, with few fields. Each of the field are not direct entry, but rather a LOV picker is attached to these, and on selecting the LOV value, the id gets stored in the field.

I have a dynamic action associated to the field, ( event - change in item, condition - always, action - Set value via SQL query ). However, on selecting the value from the LOV, the dynamic action doesn't get triggered. If I select the dynamic action to be fired on page load, then it works but not upon selection of an item from the LOV. Why is this so, is it by design or a bug ?

+1  A: 

Apex 4.0 dynamic actions don't yet work on popup LOVs. I suspect they will work by the time Apex 4.0 is released, though I don't know that for sure. I have read in Patrick Wolf's blog that the cascading LOV functionality will eventually work for popup LOVs though it does not at the moment, and I imagine the same applies here.

If your LOV isn't too huge you can change the item to a select list and the dynamic action will work.

Tony Andrews
Sathya
Yes, tabular form means multi-record form! I have updated my answer now.
Tony Andrews
BTW, I see you have asked the same question on the Oracle forum here: http://forums.oracle.com/forums/thread.jspa?messageID=4232468 and it still says "tabular". You may want to edit that and then you should get a definitive answer from one of the Apex development team, as they actively participate in that forum.
Tony Andrews
Oh! I see. Unfortunately I cannot ise a select list as the data will grow tremendously. How can I achieve the similar functionality, alternative steps ?
Sathya
You would need to write a Javascript function with AJAX calls to the database, and call it from an onchange trigger on the poplist item. See: http://www.oracleapplicationexpress.com/tutorials/68-basics-of-ajax for an example
Tony Andrews
Thanks a lot, I will have a look at it.
Sathya
Well, I tried with AJAX calls, and for a Popup LOV ( non enterable, show diplay and store return value ) with dynamic action, the change event simply doesn't fire. If I change the Popup LOV to a text field, the change event fires. Any suggestions on how I can force the onchange event ?
Sathya
Nev mind, I got it figured, added the onChange hook to HTML form element rather than relying upon dynamic actions, thanks !
Sathya
+1  A: 

Your popup Lov item makes 2 inputs in the form, P1_ITEM and P1_ITEM_HIDDENVALUE. I had no problem setting the hidden item(P1_ITEM_HIDDENVALUE) with Dynamic Action. For the P1_ITEM i created an extra hidden item(P1_EXTRA - Value Protected should be "No"), added another true action that sets P1_EXTRA with the value i need to populate in P1_ITEM. Then i added another true action (Execute JavaScript Code) with the following code:

$s('P1_ITEM',$('#P1_ITEM_HIDDENVALUE').val(),$('#P1_EXTRA').val());

hope this helps anyone

Vladimir