- Search by the component ID - use findComponentByAbsoluteId function
- Search in component that stamps its children - use findComponentByAbsoluteLocator function
- Use findComponent function. This function searches the component clientId which can be renderer implementation specific.
AdfPage.PAGE.findComponentByAbsoluteLocator example:
<af:document title="Page1" id="d1">
<af:form id="f1">
<af:panelStretchLayout id="psl1">
<f:facet name="center">
<af:panelGroupLayout id="pgl1">
<af:panelGroupLayout id="main" styleClass="AFStretchWidth" layout="vertical">
...
</af:panelGroupLayout>
</af:panelGroupLayout>
</f:facet>
</af:panelStretchLayout>
<af:resource type="javascript">
function f1(){
var main = AdfPage.PAGE.findComponentByAbsoluteId('main');
alert(main);
if(main != null) {
ActionEvent.queue(main, true);
}
}
</af:resource>
...
No comments:
Post a Comment