I’ve looked at the Primefaces selector for the “update” tag here: How do PrimeFaces Selectors as in update=”@(.myClass)” work?
I was wondering if there was something similar for the PF function selector.
If I have multiple Primefaces panels I’d like to call .toggle() on, can I do it without referencing their individual widgetVars? Either through class or some other property I can lump them together.
For example:
<script>
function enableEditing() {
try {
PF( 'pnlTest1' ).toggle(); // works
PF( 'pnlTest2' ).toggle(); // works
PF( '@(.pnlTestClass' ).toggle(); // Can it work like this to toggle all panels?
} catch ( e ) {
alert(e);
}
}
</script>
<p:panel toggleable="true" closable="true" widgetVar="pnlTest1" styleClass="pnlTestClass" >
Panel 1
</p:panel>
<p:panel toggleable="true" closable="true" widgetVar="pnlTest2" styleClass="pnlTestClass" >
Panel 2
</p:panel>