Skip to Main Content

Java Development Tools

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!

Trigger/Simulate Click Event Programmatically via ClientListerner

Nisar AhmedAug 11 2015 — edited Sep 1 2015

I've managed to get a reference to a ADF component by following the documentation. What I'm struggling now with is to programmatically trigger the click event on that component.

The source code is as follows:

ADF

<af:panelAccordion discloseMany="false" id="pa1">

     <af:showDetailItem id="pane1" text="Panel Label 1" disclosed="true">
       
<af:commandButton text="commandButton 1" id="cb1">
              
<af:clientListener method="showNext" type="action" />
       
</af:commandButton>
     </af:showDetailItem>

     <af:showDetailItem id="pane2" text="Panel Label 2">
       
<af:commandButton text="commandButton 2" id="cb2">
            
<af:clientListener method="showNext" type="action" />
       
</af:commandButton>
     </af:showDetailItem>

     <af:showDetailItem id="pane3" text="Panel Label 3">
       
<af:commandButton text="commandButton 3" id="cb3">
            
<af:clientListener method="showNext" type="action" />
       
</af:commandButton>
     </af:showDetailItem>

</af:panelAccordion>

Javascript

function showNext(evt){  
  
var src = evt.getSource();

   var showDetailItemNode = src.getParent(); // targets the showDetailItem node in which the button resides  

   /* how do I simulate the click event of this object? */

   /* For example: If button #cb1 was clicked, it should simulate clicking of the showDetailItem #pane1 */
}


Use Case

When a user clicks on a button (which is inside the showDetailitem), the parent panel should collapse and the next panel should open up. The button is just another way of triggering the panel click behaviour.


jDeveloper  Version

11g

This post has been answered by Nisar Ahmed on Aug 27 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 24 2015
Added on Aug 11 2015
6 comments
2,512 views