find ADF Faces Components in Page by javascript-findComponent

When we using JavaScript with ADF, the AdfPage.PAGE.findComponentByAbsoluteId() and AdfPage.PAGE.findComponent() are useful.

-> Search by the component ID – use findComponentByAbsoluteId function
-> Search in component that stamps its children – use findComponentByAbsoluteLocator function Relative Search
-> Use findComponent function. This function searches the component clientId which can be renderer implementation specific.

you can write a java script function like

    <af:resource type="javascript">
          function contactsPopupOpenListener(evnt) { var contactBtn =
          AdfPage.PAGE.findComponent("T:topMenuLink_contact");
          contactBtn.setStyleClass("OCCTopMenuContactLinkActive"); } function
          contactsPopupCloseListener(evnt) { var contactBtn =
          AdfPage.PAGE.findComponent("T:topMenuLink_contact");
          contactBtn.setStyleClass("OCCTopMenuContactLink"); }
        </af:resource>

happy finding of component with Vinay in Techartifact…. 🙂