Table truncated when a zoom is applicated - jsf

I have with this code a problem that is when I increase the zoom of navigator the table is truncated and the add, edit,search, save buttons disappear.
So how to solve this problem and make it scroll when we applicate a zoom.Can you help me please to solve this problem.
I am working with jdev 12c,oracle 12 and java 8
<af:panelGridLayout id="pgl3" partialTriggers="pt2">
<af:gridRow marginTop="0px" height="auto" id="gr1">
<af:gridCell marginStart="0px" styleClass="AFStretchWidth" marginEnd="0px"
id="gc1">
<af:panelBox id="pb2" styleClass="AFStretchWidth"
text="#{raficviewBundle.LISTE_DE_OBLIGATIONS}"
>
<af:spacer id="s25" height="15px"/>
<f:facet name="toolbar">
<af:toolbar id="t3">
<TC:search iterator="RefObligationVO2Iterator"
disabled="#{bindings.RefObligationVO2Iterator.estimatedRowCount == 0}"
popupId=":::popupSearch" id="s1"/>
<af:commandButton text="" id="badd"
icon="/resources/images/add.png"
shortDesc="#{raficviewBundle.Ajouter}"
styleClass="toolbarButton"
partialSubmit="true">
<af:showPopupBehavior popupId=":::p1"/>
</af:commandButton>
<af:commandButton text="" id="bmod"
icon="/resources/images/edit.png"
disabled="#{bindings.RefObligationVO2Iterator.estimatedRowCount == 0}"
shortDesc="#{raficviewBundle.MODIFIER}"
styleClass="toolbarButton"
partialSubmit="true">
<af:showPopupBehavior popupId=":::p3"/>
</af:commandButton>
<af:commandButton actionListener="#{bindings.Delete.execute}"
styleClass="toolbarButton"
disabled="#{bindings.RefObligationVO2Iterator.estimatedRowCount==0}"
icon="/resources/images/delete_outline.png"
id="breiu7" partialSubmit="true"/>
<TC:rollback block="0" id="r1"/>
<TC:valider block="0"
iterator="RefObligationVO2Iterator"
id="v1"/>
</af:toolbar>
</f:facet>
<!--1300px-->
<!--<af:panelStretchLayout id="psl2"
styleClass="AFStretchWidth"
bottomHeight="300px"
topHeight="250px">
<f:facet name="center">-->
<af:panelGroupLayout id="pgl1" styleClass="AFStretchWidth">
<af:panelCollection id="pc3" styleClass="AFStretchWidth">
<f:facet name="menus"/>
<f:facet name="toolbar">
<af:toolbar id="taeri4">
<af:button text="#{raficviewBundle.EXPORT}"
id="brei3"
shortDesc="#{raficviewBundle.EXPORT_DESC}">
<af:exportCollectionActionListener type="excelHTML"
exportedId="t5"
filename="#{items.NatLlibfr}.xls"/>
</af:button>
</af:toolbar>
</f:facet>
<f:facet name="statusbar"/>
<af:table value="#{bindings.RefObligationVO2.collectionModel}"
var="row" autoHeightRows="10"
rows="#{bindings.RefObligationVO2.rangeSize}"
emptyText="#{bindings.RefObligationVO2.viewable ? raficviewBundle.NO_DATA_TO_DISP : raficviewBundle.ACCES_DENIED}"
rowBandingInterval="0"
selectedRowKeys="#{bindings.RefObligationVO2.collectionModel.selectedRow}"
selectionListener="#{bindings.RefObligationVO2.collectionModel.makeCurrent}"
rowSelection="single"
fetchSize="#{bindings.RefObligationVO2.rangeSize}"
filterModel="#{bindings.RefObligationVO2Query.queryDescriptor}"
filterVisible="true"
queryListener="#{bindings.RefObligationVO2Query.processQuery}"
varStatus="vs" id="t5" contentDelivery="immediate"
immediate="true"
partialTriggers=":::::b3 :::::b4 :::breiu7"
columnStretching="column:c22"
styleClass="AFStretchWidth"
>
<af:column sortProperty="#{bindings.RefObligationVO2.hints.OblKcode.name}"
filterable="true" width="50px"
sortable="true"
headerText="#{bindings.RefObligationVO2.hints.OblKcode.label}"
id="c15" inlineStyle="text-align:left;">
<af:outputText value="#{row.OblKcode}"
shortDesc="#{bindings.RefObligationVO2.hints.OblKcode.tooltip}"
id="ot26">
<af:convertNumber groupingUsed="false"
pattern="#{bindings.RefObligationVO2.hints.OblKcode.format}"/>
</af:outputText>
</af:column>
<af:column sortProperty="#{bindings.RefObligationVO2.hints.OblLlibfr.name}"
filterable="true" width="300px"
sortable="true"
headerText="#{bindings.RefObligationVO2.hints.OblLlibfr.label}"
id="c16">
<af:outputText value="#{row.OblLlibfr}"
shortDesc="#{bindings.RefObligationVO2.hints.OblLlibfr.tooltip}"
id="ot27"/>
</af:column>
<af:column sortProperty="#{bindings.RefObligationVO2.hints.OblLlibar.name}"
filterable="true" width="300px"
sortable="true"
inlineStyle="text-align:right;"
headerText="#{bindings.RefObligationVO2.hints.OblLlibar.label}"
id="c17">
<af:outputText value="#{row.OblLlibar}"
shortDesc="#{bindings.RefObligationVO2.hints.OblLlibar.tooltip}"
id="ot25"/>
</af:column>
<af:column sortProperty="#{bindings.RefObligationVO2.hints.OblLabrvfr.name}"
filterable="true" width="70px"
sortable="true"
headerText="#{bindings.RefObligationVO2.hints.OblLabrvfr.label}"
id="c19">
<af:outputText value="#{row.OblLabrvfr}"
shortDesc="#{bindings.RefObligationVO2.hints.OblLabrvfr.tooltip}"
id="ot1"/>
</af:column>
<af:column sortProperty="#{bindings.RefObligationVO2.hints.OblLabrvar.name}"
filterable="true" width="70px"
sortable="true"
inlineStyle="text-align:right;"
headerText="#{bindings.RefObligationVO2.hints.OblLabrvar.label}"
id="c21">
<af:outputText value="#{row.OblLabrvar}"
shortDesc="#{bindings.RefObligationVO2.hints.OblLabrvar.tooltip}"
id="ot29"
inlineStyle="text-align:center;"/>
</af:column>
<af:column sortProperty="#{bindings.RefObligationVO2.hints.OblDdeb.name}"
filterable="true" width="65px"
sortable="true"
inlineStyle="text-align:center;"
headerText="#{bindings.RefObligationVO2.hints.OblDdeb.label}"
id="c18">
<f:facet name="filter">
<af:inputDate value="#{bindings.RefObligationVO2Query.queryDescriptor.filterConjunctionCriterion.criterionMap.OblDdeb.value}"
id="id1" autoSubmit="true">
<af:convertDateTime pattern="#{bindings.RefObligationVO2.hints.OblDdeb.format}"
secondaryPattern="ddMMyyyy"/>
</af:inputDate>
</f:facet>
<af:outputText value="#{row.OblDdeb}"
shortDesc="#{bindings.RefObligationVO2.hints.OblDdeb.tooltip}"
id="ot28">
<af:convertDateTime pattern="#{bindings.RefObligationVO2.hints.OblDdeb.format}"/>
</af:outputText>
</af:column>
<!--width="65px"-->
<af:column sortProperty="#{bindings.RefObligationVO2.hints.OblDfin.name}"
filterable="true"
inlineStyle="text-align:center;"
sortable="true"
headerText="#{bindings.RefObligationVO2.hints.OblDfin.label}"
id="c20">
<f:facet name="filter">
<af:inputDate value="#{bindings.RefObligationVO2Query.queryDescriptor.filterConjunctionCriterion.criterionMap.OblDfin.value}"
id="id11">
<af:convertDateTime pattern="#{bindings.RefObligationVO2.hints.OblDfin.format}"
secondaryPattern="ddMMyyyy"/>
</af:inputDate>
</f:facet>
<af:outputText value="#{row.OblDfin}"
shortDesc="#{bindings.RefObligationVO2.hints.OblDfin.tooltip}"
id="ot31">
<af:convertDateTime pattern="#{bindings.RefObligationVO2.hints.OblDfin.format}"/>
</af:outputText>
</af:column>
<af:column sortProperty="#{bindings.RefObligationVO2.hints.OblCtypobl.name}"
filterable="true" width="68px"
sortable="true"
headerText="#{bindings.RefObligationVO2.hints.OblCtypobl.label}"
id="c23">
<af:selectOneChoice value="#{row.bindings.OblCtypobl.inputValue}"
label="#{row.bindings.OblCtypobl.label}"
required="#{bindings.RefObligationVO2.hints.OblCtypobl.mandatory}"
shortDesc="#{bindings.RefObligationVO2.hints.OblCtypobl.tooltip}"
id="soc2" readOnly="true">
<f:selectItems value="#{row.bindings.OblCtypobl.items}"
id="si2"/>
<f:validator binding="#{row.bindings.OblCtypobl.validator}"/>
</af:selectOneChoice>
</af:column>
<af:column sortProperty="#{bindings.RefObligationVO2.hints.TextRegl.name}"
filterable="true" width="200px"
sortable="true"
headerText="#{bindings.RefObligationVO2.hints.TextRegl.label}"
id="c22">
<af:outputText value="#{row.TextRegl}"
shortDesc="#{bindings.RefObligationVO2.hints.TextRegl.tooltip}"
id="ot32"/>
</af:column>
</af:table>
</af:panelCollection>
</af:panelGroupLayout>
<!--<af:panelGridLayout id="pgl5iu">
<af:gridRow marginTop="5px" height="auto"
styleClass="AFStretchWidth" id="gri1">
<af:gridCell marginStart="5px" width="300%" styleClass="AFStretchWidth"
id="gci1"/>
</af:gridRow>
</af:panelGridLayout>-->
<!--</f:facet>
<f:facet name="end"/>
</af:panelStretchLayout>-->
</af:panelBox>
</af:gridCell>
</af:gridRow>

Related

Exporter doesn't work

I'm using an old version of PF (3.5) but I can't get DataExporter to work with the attribute selectionOnly="true".
If I don't set that attribute, everything works fine, vice versa I get this error:
Caused by: javax.el.ELException: /WEB-INF/views/AreaRiservata/Clinipass/Malattia/malattiaScaricoMandatiTesoreria.xhtml #91,61 value="#{mandato.codCompagnia}": Cannot convert codCompagnia of type class java.lang.String to class java.lang.Integer
at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:114) ~[jsf-impl-2.1.13.jar:2.1.13]
at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:186) ~[jboss-jsf-api_2.1_spec-2.0.9.Final.jar:2.0.9.Final]
at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:174) ~[jboss-jsf-api_2.1_spec-2.0.9.Final.jar:2.0.9.Final]
at javax.faces.component.UIOutput.getValue(UIOutput.java:169) ~[jboss-jsf-api_2.1_spec-2.0.9.Final.jar:2.0.9.Final]
My datatable looks like this:
<p:ajax event="rowSelectCheckbox" update=":formTable:buttons" />
<p:ajax event="rowUnselectCheckbox" update=":formTable:buttons" />
<p:ajax event="toggleSelect" update=":formTable:buttons" />
<p:ajax event="rowSelect" update=":formTable:buttons" />
<p:ajax event="rowUnselect" update=":formTable:buttons" />
<p:column selectionMode="multiple" style="width:16px;text-align:center"/>
<p:column filterMaxLength="4" filterBy="#{mandato.codCompagnia}" sortBy="#{mandato.codCompagnia}" width="75" id="amala">
<f:facet name="header">
<h:outputText value="Compagnia" />
</f:facet>
<h:outputText value="#{mandato.codCompagnia}" />
</p:column>
<p:column filterBy="#{mandato.codProdotto}" sortBy="#{mandato.codProdotto}" width="75">
<f:facet name="header">
<h:outputText value="Prodotto" />
</f:facet>
<h:outputText value="#{mandato.codProdotto}" />
</p:column>
<p:column filterBy="#{mandato.annoSinistro}" sortBy="#{mandato.annoSinistro}" width="85">
<f:facet name="header">
<h:outputText value="Anno Sinistro" />
</f:facet>
<h:outputText value="#{mandato.annoSinistro}" />
</p:column>
<p:commandButton value="Crea file" ajax="false" icon="ui-icon-document">
<p:dataExporter type="csv" target="tableScaricoMandatiTesoreria" fileName="Mandati" selectionOnly="true" />
</p:commandButton>
you missed postProcessor attribute in dataExporter Component
<p:dataExporter type="csv" target="tableScaricoMandatiTesoreria"
postProcessor="#{ExportCbean.postProcessXLS}" fileName="Mandati" selectionOnly="true" />
It's not an actual fix but i've managed to bypass the issue by creating another datatable with
id="tableScaricoMandatiTesoreriaSelected" style="display: none" value="#{malattiaScaricoMandatiTesoreriaModel.selectedMandati}"
Then I've changed the ajax's updates in the other table:
<p:ajax event="rowSelectCheckbox" update=":formTable:buttons :formTable:tableScaricoMandatiTesoreriaSelected" />
<p:ajax event="rowUnselectCheckbox" update=":formTable:buttons :formTable:tableScaricoMandatiTesoreriaSelected" />
<p:ajax event="toggleSelect" update=":formTable:buttons :formTable:tableScaricoMandatiTesoreriaSelected" />
<p:ajax event="rowSelect" update=":formTable:buttons :formTable:tableScaricoMandatiTesoreriaSelected" />
<p:ajax event="rowUnselect" update=":formTable:buttons :formTable:tableScaricoMandatiTesoreriaSelected" />
And the exporter now points to the new table:
<p:dataExporter type="xls" target="tableScaricoMandatiTesoreriaSelected" fileName="Mandati" />

primefaces dataTable with dynamic columns and filtering does no more update

I have a primefaces data table with dynamic columns and filtering for each column which shows search results. The data table is updated after each search execution with update="#form".
Unfortunately the data table is no more updated after the user has done a filtering for a column. The data table does not show new search results after an executed search until the user changes the view and returns to the data table (the search results are stored in the session), this builds the data table new from scratch.
This is the data table xhtml:
<p:dataTable id="searchResultTableId" scrollable="true" value="#{curSearch.getSearchResults()}" scrollHeight="300" var="curSearchResult"
sortMode="multiple" rowKey="#{curSearchResult.hashCode()}" draggableColumns="true" resizableColumns="true" styleClass="hitlistDataTable"
paginator="true" rows="#{curSearch.hitlistRowsPerPage}" rowIndexVar="rowIndex"
paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
rowsPerPageTemplate="#{curSearch.rowsPerPageTemplate}" paginatorPosition="bottom" tableStyleClass="searchResultTable"
selection="#{curSearch.selectedSearchResults}" widgetVar="hitlistTableVar">
<p:ajax event="colReorder" update="searchResultTableId :editPropertyFormId:editPropertyDialogId" oncomplete="hitlistTableResized();" />
<p:ajax event="rowSelect" update="#(.resultlistActionGrid) :searchInstancesFormId:listResultTabViewId:searchResultTableContextMenuId" />
<p:ajax event="rowUnselect" update="#(.resultlistActionGrid) :searchInstancesFormId:listResultTabViewId:searchResultTableContextMenuId" />
<p:ajax event="toggleSelect" update="#(.resultlistActionGrid) :searchInstancesFormId:listResultTabViewId:searchResultTableContextMenuId" />
<p:ajax event="rowSelectCheckbox"
update="#(.resultlistActionGrid) :searchInstancesFormId:listResultTabViewId:searchResultTableContextMenuId" />
<p:ajax event="rowUnselectCheckbox"
update="#(.resultlistActionGrid) :searchInstancesFormId:listResultTabViewId:searchResultTableContextMenuId" />
<p:ajax event="contextMenu" update="#(.resultlistActionGrid) :searchInstancesFormId:listResultTabViewId:searchResultTableContextMenuId"
oncomplete="PF('searchResultTableContextMenuVar').show(currentEvent);" />
<!-- double click listener -->
<p:ajax event="rowDblselect"
listener="#{editPropertyBL.initForEdit(curSearch.selectedSearchResults.get(0), curSearch.getDataViewDefinition())}"
oncomplete="PF('editPropertyDialogVar').show();" update=":editPropertyFormId #(.resultlistActionGrid)" />
<p:column style="width: 16px;">
<p:rowToggler />
</p:column>
<p:column selectionMode="multiple" style="width: 16px; text-align:center; padding-right: 12px;" />
<p:columns value="#{curSearch.determinePrimaryPropertyNames()}" var="curPrimaryPropName"
sortBy="#{curSearchResult[curPrimaryPropName].getValue()}" filterBy="#{curSearchResult[curPrimaryPropName].getValue()}"
filterMatchMode="contains">
<f:facet name="header">
<h:outputText value="#{displayNameResolver.resolveDisplayNameOfHitlistProperty(curPrimaryPropName, curSearch)}" />
</f:facet>
<ui:param name="curValue" value="#{hitlistBL.generatePropertyValue(curSearchResult, curPrimaryPropName)}" />
<ui:param name="isDocumentTitle" value="#{hitlistBL.isDocumentTitle(curPrimaryPropName)}" />
<ui:param name="isChoice" value="#{hitlistBL.isChoice(curPrimaryPropName, curSearch)}" />
<!-- doc title -->
<h:panelGroup rendered="#{curSearchResult.isChanged() and (isDocumentTitle)}" style="padding-right: 4px;">
<i class="fa fa-refresh" />
</h:panelGroup>
<!-- <p:commandLink action="#{contentBL.showContentExtern(curSearch.getViewId(), curSearchResult)}" value="#{curValue}" ajax="false"
rendered="#{(curSearchResult.isOfDataType('STRING', curPrimaryPropName)) and (isDocumentTitle) and (not isChoice)}" target="_blank" /> -->
<!-- document title -->
<h:outputText value="#{curValue}" title="#{curSearchResult.getRepresentationsAsString()}"
rendered="#{(curSearchResult.isOfDataType('STRING', curPrimaryPropName)) and (isDocumentTitle) and (not isChoice)}" />
<!-- data type STRING -->
<h:outputText value="#{curValue}"
rendered="#{curSearchResult.isOfDataType('STRING', curPrimaryPropName) and (not isDocumentTitle) and (not isChoice)}" />
<!-- data type UUID -->
<h:outputText value="#{curValue}" rendered="#{curSearchResult.isOfDataType('UUID', curPrimaryPropName) and (not isChoice)}" />
<!-- data type INTEGER32 -->
<h:outputText value="#{curValue}" rendered="#{curSearchResult.isOfDataType('INTEGER32', curPrimaryPropName) and (not isChoice)}">
<f:convertNumber integerOnly="true" groupingUsed="false" />
</h:outputText>
<!-- data type DOUBLE -->
<h:outputText value="#{curValue}" rendered="#{curSearchResult.isOfDataType('DOUBLE', curPrimaryPropName) and (not isChoice)}">
<f:convertNumber groupingUsed="false" />
</h:outputText>
<!-- data type DATETIME -->
<h:outputText value="#{curValue}" rendered="#{curSearchResult.isOfDataType('DATETIME', curPrimaryPropName) and (not isChoice)}">
<f:convertDateTime type="both" dateStyle="short" timeStyle="short" timeZone="#{settingsBL.getTimeZoneIdSet()}"
pattern="#{settingsBL.dateTimePattern}" />
</h:outputText>
<!-- CHOICE -->
<h:outputText value="#{hitlistBL.determineChoiceUiValue(curSearch.getViewId(), curSearchResult, curPrimaryPropName)}"
rendered="#{(not isDocumentTitle) and (isChoice)}" />
</p:columns>
<p:rowExpansion>
<h:panelGrid id="addPropsOuterGridId" cellpadding="0" cellspacing="0" columns="2" columnClasses="expRowImage, expRowProps"
styleClass="resultListRowExpansionGrid">
<h:panelGroup style="height: 200px;">
<p:graphicImage value="#{imageCacheBean.image}" height="200" cache="false"
rendered="#{curSearchResult.isContentRepresentationWithNameExisting('thumbnails')}">
<f:param name="searchTabId" value="#{curSearch.getTabId().toString()}" />
<f:param name="searchViewId" value="#{searchViewBL.getSelectedSearchViewId().toString()}" />
<f:param name="searchPid" value="#{curSearchResult.getPid().getPidString()}" />
</p:graphicImage>
</h:panelGroup>
<p:dataGrid id="addPropDataGridId" var="curSecondaryPropName" value="#{curSearch.determineSecondaryPropertyNames()}" columns="1"
layout="grid" styleClass="hitlistAdditionalPropDataGrid" emptyMessage="">
<ui:param name="isChoice" value="#{hitlistBL.isChoice(curSecondaryPropName, curSearch)}" />
<h:panelGrid id="addPropsInnerGridId" columns="2" cellpadding="0" cellspacing="0"
columnClasses="hitlistAddPropLabel, hitlistAddPropValue" style="width: 100%;">
<h:outputText value="#{displayNameResolver.resolveDisplayNameOfHitlistProperty(curSecondaryPropName, curSearch)}: " />
<ui:param name="curSecondaryValue" value="#{hitlistBL.generatePropertyValue(curSearchResult, curSecondaryPropName)}" />
<!-- data type STRING -->
<h:outputText value="#{curSecondaryValue}"
rendered="#{curSearchResult.isOfDataType('STRING', curSecondaryPropName) and (not isChoice)}" />
<!-- data type UUID -->
<h:outputText value="#{curSecondaryValue}" rendered="#{curSearchResult.isOfDataType('UUID', curSecondaryPropName) and (not isChoice)}" />
<!-- data type INTEGER32 -->
<h:outputText value="#{curSecondaryValue}"
rendered="#{curSearchResult.isOfDataType('INTEGER32', curSecondaryPropName) and (not isChoice)}">
<f:convertNumber integerOnly="true" groupingUsed="false" />
</h:outputText>
<!-- data type DOUBLE -->
<h:outputText value="#{curSecondaryValue}"
rendered="#{curSearchResult.isOfDataType('DOUBLE', curSecondaryPropName) and (not isChoice)}">
<f:convertNumber groupingUsed="false" />
</h:outputText>
<!-- data type DATETIME -->
<h:outputText value="#{curSecondaryValue}"
rendered="#{curSearchResult.isOfDataType('DATETIME', curSecondaryPropName) and (not isChoice)}">
<f:convertDateTime type="both" dateStyle="short" timeStyle="short" timeZone="#{settingsBL.getTimeZoneIdSet()}"
pattern="#{settingsBL.dateTimePattern}" />
</h:outputText>
<!-- CHOICE -->
<h:outputText value="#{hitlistBL.determineChoiceUiValue(curSearch.getViewId(), curSearchResult, curSecondaryPropName)}"
rendered="#{isChoice}" />
</h:panelGrid>
</p:dataGrid>
</h:panelGrid>
</p:rowExpansion>
</p:dataTable>
You need to clear the filtering while doing search on button.
Use
widgetVar="hitlistTableVar" for your datatable and then
on your command button clear the filter.
oncomplete="hitlistTableVar.clearFilters();"
Hope it should solve your problem.
`

PrimeFaces TypeError: PF(...) is undefined

I followed the DataTable Filter showcase from PrimeFaces on my own DataTable. Every time the "onkeyup" event occurs I get a
TypeError: PF(...) is undefined error in Firebug and a "Uncaught
TypeError: Cannot read property 'filter' of undefined
in Chrome Console. The filtering does not work.
Here is my XHTML page:
<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui">
<h:head>
<h:title>List of User</h:title>
</h:head>
<h:body>
<h:form id="UserForm" name="UserRecords">
<p:dataTable id="users" widgetVar="usersTable" var="user" value="#{userBean.users}" scrollable="false" frozenColumns="0" sortMode="multiple" stickyHeader="true" filteredValue="#{userBean.filteredUsers}">
<f:facet name="header">User<p:inputText id="globalFilter" onkeyup="PF('usersTable').filter()" style="float:right" placeholder="Filter"/>
<p:commandButton id="toggler" type="button" style="float:right" value="Columns" icon="ui-icon-calculator"/>
<p:columnToggler datasource="users" trigger="toggler"/>
<p:commandButton id="optionsButton" value="Options" type="button" style="float:right"/>
<p:menu overlay="true" trigger="optionsButton" my="left top" at="left bottom">
<p:submenu label="Export">
<p:menuitem value="XLS">
<p:dataExporter type="xls" target="users" fileName="users"/>
</p:menuitem>
<p:menuitem value="PDF">
<p:dataExporter type="pdf" target="users" fileName="users"/>
</p:menuitem>
<p:menuitem value="CSV">
<p:dataExporter type="csv" target="users" fileName="users"/>
</p:menuitem>
<p:menuitem value="XML">
<p:dataExporter type="xml" target="users" fileName="users"/>
</p:menuitem>
</p:submenu>
</p:menu>
</f:facet>
<p:column disabledSection="false" colspan="1" exportable="true" filterBy="#{user.firstName}" filterMatchMode="startsWith" filterStyle="display:none; visibility:hidden;" filterable="true" headerText="FirstName" priority="0" rendered="true" resizable="true" rowspan="1" selectRow="true" sortable="true" toggleable="true" visible="true">
<h:outputText value="#{user.firstName}"/>
</p:column>
<p:column disabledSection="false" colspan="1" exportable="true" filterBy="#{user.lastName}" filterMatchMode="startsWith" filterStyle="display:none; visibility:hidden;" filterable="true" headerText="LastName" priority="0" rendered="true" resizable="true" rowspan="1" selectRow="true" sortable="true" toggleable="true" visible="true">
<h:outputText value="#{user.lastName}"/>
</p:column>
<p:column disabledSection="false" colspan="1" exportable="true" filterBy="#{user.username}" filterMatchMode="startsWith" filterStyle="display:none; visibility:hidden;" filterable="true" headerText="Username" priority="0" rendered="true" resizable="true" rowspan="1" selectRow="true" sortable="true" toggleable="true" visible="true">
<h:outputText value="#{user.username}"/>
</p:column>
<p:column disabledSection="false" colspan="1" exportable="true" filterBy="#{user.password}" filterMatchMode="startsWith" filterStyle="display:none; visibility:hidden;" filterable="true" headerText="Password" priority="0" rendered="true" resizable="true" rowspan="1" selectRow="true" sortable="true" toggleable="true" visible="true">
<h:outputText value="#{user.password}"/>
</p:column>
<p:column disabledSection="false" colspan="1" exportable="true" filterBy="#{user.id}" filterMatchMode="startsWith" filterStyle="display:none; visibility:hidden;" filterable="true" headerText="Id" priority="0" rendered="true" resizable="true" rowspan="1" selectRow="true" sortable="true" toggleable="true" visible="true">
<h:outputText value="#{user.id}"/>
</p:column>
<p:column disabledSection="false" colspan="1" exportable="true" filterBy="#{user.createdOn}" filterMatchMode="startsWith" filterStyle="display:none; visibility:hidden;" filterable="true" headerText="CreatedOn" priority="0" rendered="true" resizable="true" rowspan="1" selectRow="true" sortable="true" toggleable="true" visible="true">
<h:outputText value="#{user.createdOn}"/>
</p:column>
<p:column disabledSection="false" colspan="1" exportable="true" filterBy="#{user.lastModified}" filterMatchMode="startsWith" filterStyle="display:none; visibility:hidden;" filterable="true" headerText="LastModified" priority="0" rendered="true" resizable="true" rowspan="1" selectRow="true" sortable="true" toggleable="true" visible="true">
<h:outputText value="#{user.lastModified}"/>
</p:column>
</p:dataTable>
</h:form>
</h:body>
</html>
I'm using PrimeFaces 5.2 with Mojarra 2.2.8 and JSF 2.2.10.
In my case, I found that my TypeError: PF(...) is undefined error (without the additional property error) was caused by Primefaces not being able to find the widget widgetVar="usersTable" for example because of a spelling error
In this case, the console output right above the error in Firebug gives you the explanation Widget for var 'editExecContactDialogg' not available!
That can happen when the runtime classpath is dirty of duplicate different versioned libraries. Conflicts would then occur during class loading and resource resolving.
Make sure that you're using only one version of a library. This not only applies to PrimeFaces, but also to Mojarra. Having both 2.2.8 and 2.2.10 is definitely not right.
Like #hendinas' answer, this is not the solution to the particular problem, but might be helpful for future Googlers that have the exact same error but with a different cause.
This is an additional case of #hendinas' answer, but where the thing you're referring to is not found because it does not have the same rendered conditions. Here is an example.
<ui:repeat id="extSyses" var="extSys" value="${cc.attrs.externalSystems}"
varStatus="extSysLoop">
<h:commandButton
id="YesButton" value="Yes" type="button"
rendered='#{(rptBean.canEditReport or rptBean.canAnnotateReport) and not extSys.closed)}'
onclick="PF('#{cc.attrs.prefix}yesDlg#{extSysLoop.index}').show()" />
<p:dialog id="extDocDlg" header='Enter document reference number'
rendered='#{rptBean.canEditReport and not extSys.closed)}'
widgetVar="#{cc.attrs.prefix}yesDlg#{extSysLoop.index}"
width="650" minWidth="650" modal="true">
... Dialog Content ...
</p:dialog>
</ui:repeat>
In this case, the widgetVar matched the value of onclick, so that was good. However, the rendered clause differed. If canEditReport was true, then everything worked fine. However, if canAnnotateReport was true, then the button would show up but it would have no dialog to display! When the button is clicked, the TypeError: PF(…) is undefined message is displayed.
In this example, the solution is to make the rendered clauses the same for both the button and the dialog it refers to.

JSF: Nothing happens when a button clicked

I have recently started to maintain an online system. It is using JSF with PrimeFaces for the front end, with a Java backend. JSF is a new technology for me.
When I execute the app, and click on the buttons, absolutely nothing happens. There are no errors in the execution. It simply doesn't do a thing.
Any ideas?
xHTML file:
<p:form>
<p:dialog header="Détail demande" widgetVar="demandeDialog"
resizable="false" id="demDlg" showEffect="fade" hideEffect="explode"
width="800px" closable="true" appendToBody="true" maximizable="true"
minimizable="true">
<h:commandButton value="Imprimer" type="button" icon="ui-icon-print"
styleClass="alignmentRight">
<p:printer target="displayDem" />
</h:commandButton>
<p:accordionPanel id="displayDem" multiple="true">
<p:tab title="Informations générales">
<h:panelGrid id="displayInfoGen" columns="4" cellpadding="10">
<h:outputText value="N° demande" style="font-weight:bold" />
<h:outputText
value="#{demandeController.selectedDemande.idDemande}" />
<h:outputText value="N° de devis" style="font-weight:bold" />
<h:outputText
value="#{demandeController.selectedDemande.lastDevis.numDevis}" />
<h:outputText value="Date de saisie de la demande"
style="font-weight:bold" />
<h:outputText
value="#{demandeController.selectedDemande.dateSaisie}">
<f:convertDateTime pattern="dd/MM/yyyy" />
</h:outputText>
<h:outputText value="Date de réception de la demande"
style="font-weight:bold" />
<h:outputText
value="#{demandeController.selectedDemande.dateDemande}">
<f:convertDateTime pattern="dd/MM/yyyy" />
</h:outputText>
<h:outputText value="Observations" style="font-weight:bold" />
<h:outputText
value="#{demandeController.selectedDemande.observations}" />
</h:panelGrid>
</p:tab>
<p:tab title="Programmes">
<h:panelGrid columns="4" cellpadding="10">
<h:outputText value="Programme" style="font-weight:bold" />
<h:outputText
value="#{demandeController.selectedDemande.idProgramme.codeProgImmobilier} - #{demandeController.selectedDemande.idProgramme.nomCommercial}" />
<h:outputText value="N° de lot" style="font-weight:bold" />
<h:outputText
value="#{demandeController.selectedDemande.idBien.idBien}" />
<h:outputText value="Nom de l'acquéreur" style="font-weight:bold" />
<h:outputText
value="#{demandeController.selectedDemande.idAcquereur.genreEtatCivil} #{demandeController.selectedDemande.idAcquereur.prenomAcquereur} #{demandeController.selectedDemande.idAcquereur.nomAcquereur}" />
</h:panelGrid>
</p:tab>
<p:tab title="Pièces jointes">
<h:panelGrid columns="4" cellpadding="10">
<h:outputText value="Fiche de demande de TMA"
style="font-weight:bold" />
<h:commandLink action="#{demandeController.displayPj}"
value="#{demandeController.ficheDemandeTma.nom}">
<f:setPropertyActionListener
value="#{demandeController.ficheDemandeTma}"
target="#{demandeController.ficheToDisplay}" />
</h:commandLink>
<h:outputText value="Fiche d'aide à la vente"
style="font-weight:bold" />
<h:commandLink action="#{demandeController.displayPj}"
value="#{demandeController.ficheAideVente.nom}">
<f:setPropertyActionListener
value="#{demandeController.ficheAideVente}"
target="#{demandeController.ficheToDisplay}" />
</h:commandLink>
<h:outputText value="Plans" style="font-weight:bold" />
<h:commandLink action="#{demandeController.displayPj}"
value="#{demandeController.plan.nom}">
<f:setPropertyActionListener value="#{demandeController.plan}"
target="#{demandeController.ficheToDisplay}" />
</h:commandLink>
<h:outputText value="Chèque d'ouverture de dossier reçu"
style="font-weight:bold" />
<h:outputText value="#{demandeController.chequeOuverture}" />
</h:panelGrid>
</p:tab>
<p:tab title="Devis">
<h:panelGrid columns="4" cellpadding="10">
<h:outputText value="Date de validité du devis"
style="font-weight:bold" />
<h:outputText
value="#{demandeController.selectedDemande.lastDevis.datValidite}">
<f:convertDateTime pattern="dd/MM/yyyy" />
</h:outputText>
<h:outputText value="Date du plan de référence"
style="font-weight:bold" />
<h:outputText
value="#{demandeController.selectedDemande.lastDevis.datPlanReference}">
<f:convertDateTime pattern="dd/MM/yyyy" />
</h:outputText>
<h:outputText value="Frais de dossier" style="font-weight:bold" />
<h:outputText
value="#{demandeController.selectedDemande.lastDevis.fraDossiers}" />
<h:outputText value="Frais de pilotage" style="font-weight:bold" />
<h:outputText
value="#{demandeController.selectedDemande.lastDevis.fraPilotage}" />
<h:outputText value="Frais de plan" style="font-weight:bold" />
<h:outputText
value="#{demandeController.selectedDemande.lastDevis.fraPlan}" />
<h:outputText value="Fiche option" style="font-weight:bold" />
<h:outputText
value="#{demandeController.selectedDemande.lastDevis.ficOption}" />
</h:panelGrid>
</p:tab>
<p:tab title="Lignes de chiffrages">
<h:panelGrid columns="1" cellpadding="10">
<p:dataTable var="ligne"
value="#{demandeController.selectedDemande.lastDevis.lignes}"
scrollable="true" scrollHeight="100"
emptyMessage="Pas de lignes" id="listLignes">
<p:column headerText="Lot" style="width: 10%"
sortBy="#{ligne.idLot.libelle}" rowspan="2">
<h:outputText value="#{ligne.idLot.libelle}" />
</p:column>
<p:column headerText="Descriptif" style="width: 27%"
sortBy="#{ligne.libelleDescriptif}" rowspan="2">
<h:outputText value="#{ligne.libelleDescriptif}" />
</p:column>
<p:column headerText="Charge" style="width: 12%"
sortBy="#{ligne.charge}" rowspan="2">
<h:outputText value="#{ligne.charge}" />
</p:column>
<p:column headerText="Qte" style="width: 8%"
sortBy="#{ligne.quantite}" rowspan="2">
<h:outputText value="#{ligne.quantite}" />
</p:column>
<p:column headerText="M. unit" style="width: 9%"
sortBy="#{ligne.montantUnitaire}" rowspan="2">
<h:outputText value="#{ligne.montantUnitaire}" />
</p:column>
<p:column headerText="M. total" style="width: 10%"
sortBy="#{ligne.montantTotal}" rowspan="2">
<h:outputText value="#{ligne.montantTotal}" />
</p:column>
<p:column headerText="Possibilité" style="width: 23%"
sortBy="#{ligne.possibilite}" rowspan="2">
<h:outputText value="#{ligne.possibilite}" />
</p:column>
</p:dataTable>
<h:panelGrid id="charges" columns="4" cellpadding="10"
style="text-align: center;margin-left: 25%;width: 50%; margin-right: 25%; margin-top: 30px; background-color:RGB(225,240,233)">
<h:outputText id="chargeSncHt" value="Charge SNC HT"
style="font-weight:bold" />
<h:outputText for="chargeSncHt"
value="#{demandeController.chargeSncHt}">
<f:convertNumber maxFractionDigits="2" />
</h:outputText>
<h:outputText id="chargeAcqHt" value="Charge Acq HT"
style="font-weight:bold" />
<h:outputText for="chargeAcqHt"
value="#{demandeController.chargeAcqHt}">
<f:convertNumber maxFractionDigits="2" />
</h:outputText>
<h:outputText id="chargeSncTtc" value="Charge SNC TTC"
style="font-weight:bold" />
<h:outputText for="chargeSncTtc"
value="#{demandeController.chargeSncTtc}">
<f:convertNumber maxFractionDigits="2" />
</h:outputText>
<h:outputText id="chargeAcqTtc" value="Charge ACQ TTC"
style="font-weight:bold" />
<h:outputText for="chargeAcqTtc"
value="#{demandeController.chargeAcqTtc}">
<f:convertNumber maxFractionDigits="2" />
</h:outputText>
</h:panelGrid>
</h:panelGrid>
</p:tab>
<p:tab title="Documents">
<h:panelGrid columns="5" cellpadding="2" width="100%"
style="text-align: center">
<h:commandButton title="Générer le devis" id="genDevis"
actionListener="#{demandeController.genererDevis}" immediate="true"
image="/resources/images/pdf.png"
style="vertical-align: middle">
Devis convention.pdf
</h:commandButton>
<p:commandButton title="Plans scannés" id="addPlansScannes"
style="vertical-align: middle; width: 130px;"
onclick="lazyload()" ajax="true" icon="ui-icon-search"
value="Plans scannés">
<f:ajax event="click"
listener="#{demandeController.onPlansClicked}" />
</p:commandButton>
<h:commandButton title="Générer le courrier" id="genCourrier"
action="#{demandeController.genererCourrier}" immediate="true"
image="/resources/images/pdf.png"
style="vertical-align: middle">
Courrier pour les acquereurs.pdf
</h:commandButton>
<h:commandButton title="Générer la fiche suiveuse"
id="genFicheSuiveuse" action="#{ficheSuiveuseController.init}"
immediate="true"
image="/resources/images/excel.png"
style="vertical-align: middle">
Fiche suiveuse.xls
<f:setPropertyActionListener
value="#{demandeController.selectedDemande}"
target="#{ficheSuiveuseController.selectedDemande}" />
</h:commandButton>
</h:panelGrid>
<h:panelGrid columns="1" cellpadding="10" width="100%"
style="text-align: center" id="lazypanel">
<p:dataTable id="plansDT" var="plan"
value="#{demandeController.listPlansScannes}"
rendered="#{demandeController.plansClicked}"
emptyMessage="Pas de Plan">
<p:column headerText="Plans" style="width: 100%"
sortBy="#{plan.nom}">
<h:commandLink action="#{demandeController.displayFiles}"
value="#{plan.nom}">
<f:setPropertyActionListener value="#{plan}"
target="#{demandeController.ficheToDisplay}" />
</h:commandLink>
</p:column>
</p:dataTable>
</h:panelGrid>
<p:remoteCommand name="lazyload" update="lazypanel"
actionListener="#{demandeController.onPlansClicked()}">
</p:remoteCommand>
</p:tab>
</p:accordionPanel>
</p:dialog>
</p:form>
EDIT
When I inspect the element I get this:
<input id="detailsDemandesForm:displayDem:genDevis" type="image" title="Générer le devis" style="vertical-align: middle" name="detailsDemandesForm:displayDem:genDevis" src="/workflowtma-presentation-war/resources/images/pdf.png"></input>
Devis convent…
From a quick glance your issue might be caused by No. 1 of the list of such problems.
In particular your use of appendToBody="true" makes me suspect that Primefaces is moving your dialog out of the <p:form> you declared it in. Try moving the form inside the dialog like so:
<p:dialog ...>
<p:form>
<!-- content goes here -->
</p:form>
</p:dialog>

richfaces 4.0.0 rich:popupPanel not showing

How can i show a rich:popupPanel in richfaces 4 m5? The next code doesn't work for me.
<a4j:commandLink value="#{bean.phone}" render="popDiv" execute="#this" >
<f:setPropertyActionListener target="#{personController.person}" value="#{bean}" />
<rich:componentControl target="personModalPanel" operation="show" event="onclick" />
</a4j:commandLink>
<rich:popupPanel id="personModalPanel" modal="true" width="200" height="200">
<f:facet name="header">
<h:panelGroup>
<h:outputText value="Edit Person" />
</h:panelGroup>
</f:facet>
<f:facet name="controls">
<h:panelGroup>
<h:graphicImage value="/resources/img/x.png" styleClass="hidelink" id="hidelink" >
<rich:componentControl target="personModalPanel" operation="hide" event="onclick" />
</h:graphicImage>
</h:panelGroup>
</f:facet>
</rich:popupPanel>
In Richfaces 4, you need to write event name without 'on' word. So the given code should work for you.
<a4j:commandLink value="#{bean.phone}" render="popDiv" execute="#this" >
<f:setPropertyActionListener target="#{personController.person}" value="#{bean}" />
<rich:componentControl target="personModalPanel" operation="show" event="click" />
</a4j:commandLink>
<rich:popupPanel id="personModalPanel" modal="true" width="200" height="200">
<f:facet name="header">
<h:panelGroup>
<h:outputText value="Edit Person" />
</h:panelGroup>
</f:facet>
<f:facet name="controls">
<h:panelGroup>
<h:graphicImage value="/resources/img/x.png" styleClass="hidelink" id="hidelink" >
<rich:componentControl target="personModalPanel" operation="hide" event="onclick" />
</h:graphicImage>
</h:panelGroup>
</f:facet>
</rich:popupPanel>
Here is the core of the popup panel.
<a4j:commandLink value="Register"
onclick="#{rich:component('regWizard')}.show()">
</a4j:commandLink>
<rich:popupPanel id="regWizard"
autosized="true"
modal="true"
onmaskclick="#{rich:component('regWizard')}.hide()">
<f:facet name="header">
<h:outputText value="Registration Wizard" />
</f:facet>
<f:facet name="controls">
<h:outputLink value="#"
onclick="#{rich:component('regWizard')}.hide(); return false;">
X
</h:outputLink>
</f:facet>
</rich:popupPanel>

Resources