width="90%" height="90vh" fitViewport="true" responsive="true"
Prevent a dialog from closing if there are validation errors:
<p:commandButton ...the ususal jazz...
oncomplete="if (!args.validationFailed) {PF('violation-add-dialog-var').hide();}"
update="violation-add-form
violation-growl-form"/>
| EL Expression | What It Returns | Use Case |
|---|---|---|
#{cc.attrs.propertyName} |
Value of attribute propertyName |
Access passed-in data |
#{cc.clientId} |
Full client ID with prefixes | Unique widget vars, form IDs |
#{cc.id} |
Simple ID (if assigned) | Update targets within component |
#{cc.parent} |
Parent UIComponent | Advanced component tree manipulation |
#{cc.namingContainer} |
The composite as NamingContainer | Advanced framework use |
Thanks to Sonnet 4.5...
Add this function to the top of the page:
<script type="text/javascript">
function handleAdvancedPanelAutoExpand(autoExpand) {
var panel = PF('prop-search-controls-panel-var');
if (panel) {
// Handle undefined or missing value
if (autoExpand === undefined || autoExpand === null) {
panel.expand();
} else if (autoExpand === true || autoExpand === 'true') {
panel.expand();
} else {
panel.collapse();
}
}
}
</script>
Then use this in the change listener:
<p:selectOneMenu id="prop-search-query-som"
tabindex="1"
value="#{propertySearchBB.querySelected}"
style="width: 100%"
>
<f:converter converterId="bOBQueryConverter"/>
<f:selectItem itemLabel="select a query..."
noSelectionOption="true"
itemDisabled="true"
/>
<f:selectItems id="prop-search-query-si"
value="#{propertySearchBB.queryList}"
var="ql"
itemValue="#{ql}"
itemLabel="#{ql.queryTitle}"
/>
<p:ajax update="prop-search-params-form
query-selected-description
prop-search-messages-form"
listener="#{propertySearchBB.changeQuerySelected}"
oncomplete="handleAdvancedPanelAutoExpand(args.autoExpandAdvanced)"
/>
</p:selectOneMenu>
And this in the backing bean
/**
* Listener method for changes in the selected query;
* Updates search params and UI updates based on this changed value
*/
public void changeQuerySelected(){
System.out.println("PropertySearchBB.changeQuerySelected | querySelected: " + querySelected.getQueryTitle());
configureParameters();
// Pass autoExpandAdvanced flag to client for advanced panel control
PrimeFaces.current().ajax().addCallbackParam("autoExpandAdvanced",
querySelected.getQueryName().isAutoExpandAdvanced());
}