Showing posts with label Open or close adf panelbox using javascript. Show all posts
Showing posts with label Open or close adf panelbox using javascript. Show all posts

Saturday, February 15, 2020

ADF Open/Close af:PanelBox with click on panelbox header



In ADF panelbox is closed or open on click of icon in header icon and not on text in panel box header

With Below code snippet you can open/close  panelbox on click of anywhere in header.

<f:view xmlns:f="http://java.sun.com/jsf/core" xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
  <af:document title="PanelBoxTester.jsf" id="d1">
    <af:resource type="javascript">
       function togglePanelBox(mouseEvent){
          var panelBox = mouseEvent.getSource();
          panelBox.broadcast(new AdfDisclosureEvent(panelBox, !panelBox.getDisclosed()));
       }
     </af:resource>
        <af:form id="f1">
          <af:panelBox text="PanelBox1" id="pb1">
              <f:facet name="toolbar"/>
                <af:clientListener method="togglePanelBox" type="dblClick"/>
            </af:panelBox>
        </af:form>
    </af:document>

</f:view>