0

Users just noticed a big bug in my datatable. When you use a datatable and a column toggler, unselecting a column just shift some rows, but it goes wrong when some cells are empty.

So i tried to refresh my data table with

`<p:columnToggler datasource="datalist" trigger="toggler">
  <p:ajax event="toggle" update="datalist"/>
</p:columnToggler>`

but it goes wrong with :

`<p:columns value="#{consultationView.columns}" var="column" columnIndexVar="colIndex" 
visible="#{column.property.matches('Z06|Z07|Z09')}" >`

Because if i unselected a visible column it makes it visible again...

here is the full datatable : `

 <f:facet name="header">
 <p:commandButton process="listFDP" icon="ui-icon-file-pdf" value="Editer les fiches de paie" action="#{consultationView.printPaieAgent()}" escape="false" ajax="false" onclick="this.form.target='_blank'" />

 <p:commandButton id="toggler" type="button" value="Colonnes"
                            style="float:right" icon="ui-icon-calculator" />
 <p:columnToggler datasource="datalist" trigger="toggler">
  <p:ajax event="toggle" update="datalist"/>
 </p:columnToggler>

 </f:facet>

 <p:column selectionMode="multiple" style="width:16px;text-align:center" exportable="false" toggleable="false" />
 <p:column style="width:60px;text-align:left"
                        sortBy="#{row.gestion.datePaiement}" headerText="Pér. Paie" groupRow="true" sortOrder="ASCENDING" >
 <h:outputText value="#{row.gestion.datePaiement}">
 <f:converter binding="#{dateConverterMoisAnnee}" />
 </h:outputText>
 </p:column>
 <p:column style="width:60px;text-align:left"
                        sortBy="#{row.gestion.dateOrigine}" headerText="Pér. Origine">
                        <h:outputText value="#{row.gestion.dateOrigine}">
 <f:converter binding="#{dateConverterMoisAnnee}" />
 </h:outputText>
 </p:column>

 <p:column headerText="N° cont." style="width:25px;text-align:center;white-space:pre-line;">
 <h:outputText value="#{row.gestion.matricule.substring(10)}" />
 </p:column>

 <p:column headerText="Statut" style="width:150px;text-align:left;white-space:pre-line;" sortBy="#{row.statut}">
 <h:outputText value="#{row.statut}" />
 </p:column>

 <p:columns value="#{consultationView.columns}" var="column" columnIndexVar="colIndex" 
                        visible="#{column.property.matches('Z06|Z07|Z09')}" >
 <f:facet name="header">
  <h:outputText value="#{column.header}" />
 </f:facet>
 <h:outputText value="#{row.getRubValue(column.property)}" />
 </p:columns>
</p:dataTable>`

Sorry Long post xs

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
coshikipix
  • 59
  • 1
  • 9
  • ok i'll do so ;-) – coshikipix Feb 16 '18 at 10:25
  • I still need help, but i found something more. I noticed that some cells have : x the ui-helper-hidden class should only display with the toggler. But here some cells have it when they sould not. any idea why? – coshikipix Feb 22 '18 at 14:35
  • Is your columnToggler tag within the "datalist" element that the ajax is updating? This might be the problem if it's updating itself. – nettie Mar 02 '18 at 16:03

0 Answers0