Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Dynamic action on checkbox using jQuery selectors

Scott WesleyOct 24 2012 — edited Oct 24 2012
Aim: Have a classic report with a checkbox for each record that fires a dynamic action. I'd like to source the relevant ID/value within Javascript (ultimately PL/SQL)

Consider a classic report using the following query
SELECT label
,apex_item.checkbox
  (p_idx   => 15 -- f42
  ,p_value => id
  ,p_attributes => 'id="f15_'||id||'" class="xyz"'
  ) chk
FROM   my_table
Define a dynamic action with
Event: Click
Selection type: jQuery selector
jQuery selector: .xyz
No condition
Scope:Bind

I have an action executing javascript
var me = this.triggeringElement;
console.log('me:'||me);
console.log('name:'||me.attr('name') );
console.log('id:'||me.attr('id') );
console.log('value:'||me.prop('val'));
Affected elements Selection type: Triggering element

When I run the page and check a box, the DA fires, but all output shown in the console log is blank.
I've tried copious variations to get this right, such as using $(this.triggeringElement)

These pages make me feel confident I have the syntax right
http://stackoverflow.com/questions/12038392/oracle-apex-checkbox-to-manipulate-other-values-when-checked-unchecked
http://iadviseblog.wordpress.com/2011/08/24/get-triggering-element-in-da/

But my values are still null?! Anyone know what I've missed?

Apex 4.1.1

Scott
This post has been answered by Tom Petrus on Oct 24 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 21 2012
Added on Oct 24 2012
3 comments
4,986 views