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