Wednesday, December 8, 2010

Dynamic Action on Button-Item

Reading the post How to Trigger Dynamic Action From Button by Martin Giffy D'Souza, I decided to give the dynamic action on buttons another try.
The action on the 'normal' button (in a region position) can be added as described and works perfectly, but if I want to do the same with the button-item, I get an unwanted effect - despite of disabling/rewriting the click event, the site will redirect: the apex.submit does the job.
The only trick that works is to remove the attribute 'onclick' explicitly attr('onclick','') and then to add the new event.

Create Dynamic Action -> Advanced -> Event: Page Load -> Action: Excecute JS Code

$(this.affectedElements) //when you choose Selection Type: Item(s) (by HTML button)
or
$('#custom') //with known id
  .attr('onclick','')
  .click(function(){alert('my event')})



This can, of course, be splitted into OnLoad action (disable the click first) and then another one to add a custom event.
All roads lead to Rome.

1 comment:

  1. Top 10 Casino Sites in Kenya - Top 10 Casino Sites in Kenya
    The online gambling industry 바카라 노하우 is booming in Kenya, and it is also gaining momentum 세븐 포커 in other 룰렛 parts 점심 메뉴 룰렛 of 슈어맨 the world. With the growth of online gambling in

    ReplyDelete