It keeps showing the previous value instead of the new one.
<p:panel id="instantTransPanel" header="Quick Transfer (To Beneficiary)" toggleable="true" closable="false" toggleSpeed="500" closeSpeed="500" widgetVar="instantTransPanelVar"
rendered="#{userMBean.loggedOnUser.customer.customerType != constantuserMBean.getFETSTYPE() and (userMBean.loggedOnUser.customer.customerType != constantuserMBean.getMERCHANTTYPE() or (userMBean.loggedOnUser.customer.customerType == constantuserMBean.getMERCHANTTYPE() and userMBean.loggedOnUser.customer.hasCustomerCapability))}">
<p:commandButton value="Add New Beneficiary" onclick="addBendlg.show();" />
<br/><br/>
<p:dataTable id="beneficiariesTable" var="obj" value="#{userMBean.loggedOnUser.customer.customerBeneficiaryList}"
paginator="true" rows="20"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
rowsPerPageTemplate="20,50,100" style="width:100%" resizableColumns="true">
<p:column sortBy="#{obj.beneficiaryMsisdn}" headerText="Mobile Number" filterBy="#{obj.beneficiaryMsisdn}" filterMatchMode="contains">
<h:outputText value="#{obj.beneficiaryMsisdn}" />
</p:column>
<p:column sortBy="#{obj.beneficiaryName}" headerText="Name" filterBy="#{obj.beneficiaryName}" filterMatchMode="contains">
<h:outputText value="#{obj.beneficiaryName}" />
</p:column>
<p:column sortBy="#{obj.crt_dt}" headerText="Date Added">
<h:outputText value="#{obj.crt_dt}" />
</p:column>
<p:column headerText="Transfer">
<p:commandButton value="Transfer" update=":form:transferBenPanel" action="#{engineMBean.initTransfer(obj.beneficiaryMsisdn, obj.beneficiaryName)}" oncomplete="transferToBendlg.show();" />
</p:column>
<p:column headerText="Delete">
<p:commandButton ajax="false" onclick="return confirm('Are you sure?');" action="#{userMBean.deleteBeneficiary(obj.beneficiaryMsisdn)}" icon="ui-icon-close" style="margin:0"/>
</p:column>
</p:dataTable>
</p:panel>
After that it calls dialog and it works properly the first time but the next time I want to enter another value once clicked it pops up with the old values.
<p:dialog id="addBenDialog" header="Add Beneficiary" widgetVar="addBendlg" modal="true" dynamic="true" position="center">
<p:panelGrid columns="2" cellpadding="5" style="margin-bottom:10px;">
<f:facet name="header"></f:facet>
<h:outputLabel for="bmsisdn" value="Beneficiary Mobile Number: *" />
<p:inputText id="bmsisdn" value="#{userMBean.beneficiary.beneficiaryMsisdn}">
<p:ajax update="bname" />
</p:inputText>
<h:outputLabel for="bname" value="Beneficiary Name: " />
<h:outputText id="bname" value="#{userMBean.lookUpBeneficiaryName(userMBean.beneficiary.beneficiaryMsisdn)}" />
<f:facet name="footer">
<p:commandButton ajax="false" onclick="return confirm('Are you sure?');" action="#{userMBean.addBeneficiary}" value="Save" icon="ui-icon-disk" style="margin:0"/>
</f:facet>
</p:panelGrid>
</p:dialog>
You need to update the dialog box before it shows.
Change code as:
<p:commandButton value="Add New Beneficiary" onComplete="addBendlg.show(); update=:form:addBenDialog" />
Related
I use primefaces in my project and i'm facing some issues with it's components.
I have a dataTabe inside an accordion and both of them are populated with a list in my managed bean. The thing is, before I put this dataTable inside the accordion the filter used to work just fine. When it was into the accordion, actualy the results were corresponding to the filter, but if I click on a comandButton in any row the object that I get from the "f:setPropertyActionListener" is not corresponding to the list after the filter.
Edit:
-Primefaces 6.0
-Dynamic Web Module 3.0
-Java 1.7
-Mojarra JSF Implementation 2.2.3
The .xhtml:
<h:form id="frmPrincipal" enctype="multipart/form-data">
<p:toolbar style="background : none; border:0px">
<f:facet name="left">
<p:commandButton value="Novo Documento" oncomplete="PF('dlgIncluirDocumento').show();"
actionListener="#{MyBean.prepararInclusao()}" update=":frmIncDocVal:pngIncDoc
:frmIncDocVal:pnlTblEmail :frmIncDocVal:pnlEmailNvDoc" />
</f:facet>
</p:toolbar>
<p:accordionPanel dynamic="true" value="#{MyBean.grupos}" var="grupo">
<p:tab title="#{grupo.nome}">
<p:dataTable id="tbValidadeDocFiltrado" widgetVar="#{grupo.idComponente}"
emptyMessage="Nenhum registro enccontrado" lazy="false"
value="#{grupo.documentos}" var="item" filteredValue="#{grupo.documentosFiltrados}"
paginator="true" rows="30" paginatorPosition="bottom" rowsPerPageTemplate="15,30,45">
<f:facet name="header"><p:outputLabel value="Validade Documento" /></f:facet>
<p:column headerText="Empresa" sortBy="#{item.tipoDocumento.empresa.nome}" filterBy="#{item.tipoDocumento.empresa.nome}">
<f:facet name="filter">
<p:selectOneMenu onchange="PF('#{grupo.idComponente}').filter()" >
<f:selectItem itemLabel="Selecione" itemValue="#{null}"
noSelectionOption="true" />
<f:selectItems value="#{MyBean.itensEmpresa}"
var="empresa" itemValue="#{empresa.nome}"
itemLabel="#{empresa.nome}" />
</p:selectOneMenu>
</f:facet>
<p:outputLabel value="#{item.tipoDocumento.empresa.nome}" />
</p:column>
<p:column headerText="Departamento"
sortBy="#{item.tipoDocumento.departamento.nome}"
filterBy="#{item.tipoDocumento.departamento.nome}">
<f:facet name="filter">
<p:selectOneMenu onchange="PF('#{grupo.idComponente}').filter()">
<f:selectItem itemLabel="Selecione" itemValue="#{null}"
noSelectionOption="true" />
<f:selectItems value="#{MyBean.itensDepartamento}"
var="departamento" itemValue="#{departamento.nome}"
itemLabel="#{departamento.nome}" />
</p:selectOneMenu>
</f:facet>
<p:outputLabel value="#{item.tipoDocumento.departamento.nome}" />
</p:column>
<p:column headerText="Documento" sortBy="#{item.tipoDocumento.nome}"
filterBy="#{item.tipoDocumento.nome}">
<p:outputLabel value="#{item.tipoDocumento.nome}" />
</p:column>
<p:column headerText="Arquivo">
<p:commandLink title="Download" value="#{item.arquivo.nome}" ajax="false" onclick="PrimeFaces.monitorDownload(start, stop);" rendered="#{item.cadastroDocumentoDownload}" disabled="#{ ! item.icArquivo}">
<f:setPropertyActionListener value="#{item}" target="#{MyBean.validadeDocumento}" />
<p:fileDownload value="#{MyBean.fileDown}" />
</p:commandLink>
</p:column>
<p:column headerText="Opções" exportable="false" width="160">
<p:commandButton icon="ui-icon-pencil" title="Alterar"
oncomplete="PF('dialog1').show();"
disabled="false" rendered="#{item.cadastroDocumentoEditar}"
action="#{MyBean.prepararAlterarTipoDocumento()}"
update=":idTituloTpDocTituloTelaDlgAlt :frmAltTpDoc:pngAltDoc">
<f:setPropertyActionListener value="#{item}" target="#{MyBean.validadeDocumento}" />
</p:commandButton>
</p:column>
</p:dataTable>
</p:tab>
</p:accordionPanel>
</h:form>
Print with the command button working:
Print with the command button not working after filter:
<p:dataTable var="item" id="datatable-list" value="#{generalJournalEntryMB.generalJournalEntries}" rows="10"
paginator="true" reflow="true" paginatorPosition="top" rowExpandMode="single"
rendered="#{generalJournalEntryMB.generalJournalEntries.size() > 0}" rowIndexVar="rowIndex"
paginatorTemplate="{CurrentPageReport} {PreviousPageLink} {NextPageLink} " rowKey="#{item.id}"
selectionMode="single" selection="#{generalJournalEntryMB.generalJournalEntry}" widgetVar="datatable-list">
<p:column style="width:16px">
<p:rowToggler />
</p:column>
<p:column headerText="Id">
<h:outputText value="#{item.id}" />
</p:column>
<p:column headerText="Description">
<h:outputText value="#{item.description}" />
</p:column>
<p:column headerText="Amount">
<h:outputText value="#{item.amount}" />
</p:column>
<p:column headerText="Reference">
<h:outputText value="#{item.reference}" />
</p:column>
<p:column headerText="State">
<h:outputText value="#{item.postingState.value}" />
</p:column>
<p:rowExpansion id="expand" rendered="true">
<p:panelGrid columns="2" columnClasses="label,value" style="width:300px">
<h:outputText value="Id:" />
<h:outputText value="1" />
<h:outputText value="Year" />
<h:outputText value="1983" />
<h:outputText value="Color:" />
<h:outputText value="White" />
<h:outputText value="Price" />
<h:outputText value="#{generalJournalEntryMB.price}" />
</p:panelGrid>
</p:rowExpansion>
<p:ajax event="rowSelect" listener="#{generalJournalEntryMB.rowSelectListener}" update="main:top-menu-bar" />
<p:ajax event="rowToggle" listener="#{generalJournalEntryMB.rowToggleListener}" update="main:top-menu-bar" />
</p:dataTable>
When I expand the row without selecting the row, it show nothing. Currently what am I doing is to first select row and expand it to get desire result.
How we can trigger rowSelect even / ajax call automatically when rowToggle event fire?
You can override primefaces toggleExpansion function so it executes selectRow before
PrimeFaces.widget.DataTable.prototype.toggleExpansion = (function() {
var cached_function = PrimeFaces.widget.DataTable.prototype.toggleExpansion;
return function() {
var row = arguments[0].closest('tr');
if(this.cfg.selectionMode === 'single') {
this.unselectAllRows();
}
if(this.cfg.selectionMode){
this.selectRow(row, false);
}
var result = cached_function.apply(this, arguments);
return result;
};
})();
As you can see i first look for a person with a first commandButton, then i select a person in the datatable and i have a second commandButton, and i'd like to switch the defaultCommand on button2 after i selected a person, how can i achieve this?
<h:form id="form"
rendered="#{security.asRole('ADMIN') or security.asRole('GESTIONNAIRE')}">
<f:event type="preRenderView" listener="#{paieAgentView.init()}" />
<p:fieldset legend="Recherche de l'agent">
<p:panelGrid columns="2">
<p:panelGrid columns="2" id="pgRechercheAgent">
<h:outputLabel value="Matricule :" />
<p:inputText id="matricule"
value="#{paieAgentView.agentSearched.matricule}">
<p:ajax process="matricule" partialSubmit="true" event="keyup" />
<h:commandButton id="boutonLigneAgent"
action="#{paieAgentView.searchLigneAgent()}"
value="Rechercher les agents" icon="ui-icon-search"
update="listAgents" immediate="true" >
<f:ajax render="#form" execute="#this" />
</h:commandButton>
<br />
</p:panelGrid>
<p:dataTable id="listAgents" var="agt"
value="#{paieAgentView.listLigneAgent}"
selection="#{paieAgentView.agentSelected}"
rowKey="#{agt.matricule}" style="margin-bottom:0"
selectionMode="single" scrollRows="20" scrollable="true"
liveScroll="true" scrollHeight="250">
<p:ajax event="rowSelect" update=":form:pgRechercheContrats" />
<p:column headerText="Matricule">
<h:outputText value="#{agt.matricule}" />
</p:column>
<p:column headerText="Nom">
<h:outputText value="#{agt.nomPat} #{agt.prenom}" />
</p:column>
</p:dataTable>
</p:panelGrid>
<p:defaultCommand target="boutonLigneAgent" />
</p:fieldset>
<p:fieldset legend="Critères de recherche">
<p:panelGrid columns="3" id="pgRechercheContrats">
<h:panelGrid columns="1" style="margin-bottom:10px" cellpadding="5">
<p:outputLabel for="typePeriode" value="Période de paie:" />
<p:selectOneRadio id="typePeriode"
value="#{paieAgentView.typePeriode}">
<f:selectItem itemLabel="Période de paie" itemValue="paie" />
<f:selectItem itemLabel="Période d'origine" itemValue="origine" />
</p:selectOneRadio>
</h:panelGrid>
<h:panelGrid columns="2" id="pgCalendar">
<h:outputLabel value="Date Debut : " for="calendrierDateDebut" />
<p:calendar id="calendrierDateDebut"
value="#{paieAgentView.dateDebut}" pattern="yyyy-MM-dd"
effect="slideDown" navigator="true" mode="inline"
locale="#{sessionControleur.langue}" style="moisAnSeul" />
<h:outputLabel value="Date fin : "
for="calendrierDateFin" />
<p:calendar id="calendrierDateFin"
value="#{paieAgentView.dateFin}" pattern="yyyy-MM-dd"
effect="slideDown" navigator="true" mode="inline" lang="fr"
locale="fr" style="moisAnSeul" />
</h:panelGrid>
<p:selectManyCheckbox id="gridTypesPaie"
value="#{paieAgentView.selectedTypesPaie}" columns="1"
layout="pageDirection">
<f:selectItems value="#{paieAgentView.typesPaie}" var="type"
itemLabel="#{type.label}" itemValue="#{type.value}" />
</p:selectManyCheckbox>
</p:panelGrid>
</p:fieldset>
<p:commandButton process="pgRechercheContrats"
icon="ui-icon-file-pdf" value="Editer les fiches de paie"
action="#{paieAgentView.printPaieAgent()}" update="#form"
escape="false" ajax="false"
onclick="regenererCal();this.form.target='_blank'" />
</h:form>
Make 2 defaultCommands both with rendered attribute. Rendered should check if person is selected or not and action called must be appropriete on that. since you are updating whole form every time something change this should work
<p:defaultCommand target="boutonLigneAgent" rendered="#{personIsSelected()}"/>
<p:defaultCommand target="pgRechercheContrats" rendered="#{personIsNotSelected()}"/>
I am using primefaces 3.4.2 jar. I have a datatable with four columns. In two columns I have a datalist and I want to export text showed by datalist. But when I export it, it shows the following "org.primefaces.component.datalist.DataList#1195cc3" in the pdf and xls file.
<p:dataTable emptyMessage="#{messages['empty.result.set']}" id="searchResult" var="row" value="#{managePessoaJuridica.manageableList}" rows="10" paginator="true" paginatorPosition="top" paginatorAlwaysVisible="false" style="display:#{managePessoaJuridica.manageableList == null? 'none': ''}">
<p:column styleClass="column_icons" exportable="false">
<p:panelGrid columns="#{pessoaJuridicaController.showSelectAction?3:2}">
<p:commandButton id="selectAction" icon="ui-icon-circle-check" title="#{messages['action.select']}" action="#{pessoaJuridicaController.select(row.id)}" immediate="true" process="#this" rendered="#{pessoaJuridicaController.showSelectAction}"/>
<p:commandButton id="editAction" icon="ui-icon-pencil" title="#{messages['action.edit']}" action="#{pessoaJuridicaController.load(row.id)}" immediate="true" process="#this" update="#form"/>
<p:commandButton id="deleteAction" icon="ui-icon-trash" title="#{messages['action.delete']}" action="#{pessoaJuridicaController.delete(row.id)}" immediate="true" process="#this" update="searchResult"
onclick="return confirm('#{messages['confirm.delete.this']} #{messages['pessoa.juridica.view.title']}');" />
</p:panelGrid>
</p:column>
<p:column id="column_nome" sortBy="#{row.nome}" >
<f:facet name="header">
<h:outputText id="columnHeader_nome" value="#{messages['pessoa.nome']}"/>
</f:facet>
<h:outputText id="nome" value="#{row.nome}">
</h:outputText>
</p:column>
<p:column style="width:0px;">
<f:facet name="header">
<h:outputText id="columnHeader_categoriasPessoa" value="#{messages['pessoa.categorias.pessoa']}"/>
</f:facet>
<p:dataList type="definition" id="categoriasPessoa" var="item" value="#{row.categoriasPessoa}" >
<p:column>
<h:outputText id="item_categoriasPessoa" value="#{item}" converter="com.domain.configuracao.crud.CategoriaPessoaJsfConverter"/>
</p:column>
</p:dataList>
</p:column>
<p:column style="width:0px;">
<f:facet name="header">
<h:outputText id="columnHeader_identificacoesPessoa" value="#{messages['pessoa.identificacoes.pessoa']}"/>
</f:facet>
<p:dataList type="definition" id="identificacoesPessoa" var="item" value="#{row.identificacoesPessoa}">
<p:column>
<h:outputText id="item_categoriaIdentificacoes" value="#{pessoaJuridicaController.getCategoriaIdentificacao(item)}" converter="com.domain.configuracao.crud.CategoriaIdentificacaoJsfConverter"/>:
<h:outputText id="item_identificacoesPessoa" value="#{item}" converter="com.domain.configuracao.crud.IdentificacaoPessoaJsfConverter"/>
</p:column>
</p:dataList>
</p:column>
<p:column id="column_ativo" sortBy="#{row.ativo}" >
<f:facet name="header">
<h:outputText id="columnHeader_ativo" value="#{messages['classe.base.cadastro.ativo']}" />
</f:facet>
<h:outputText id="ativo" value="#{row.ativo}" converter="com.BooleanJsfConverter" >
</h:outputText>
</p:column>
<f:facet name="footer">
<p:menuButton value="#{messages['export.action']}" rendered="#{not empty managePessoaJuridica.manageableList}">
<p:menuitem value="#{messages['export.spreadsheet']}" ajax="false">
<p:dataExporter type="xls" target="searchResult" fileName="export" excludeColumns="0" encoding="ISO-8859-1"/>
</p:menuitem>
<p:menuitem value="#{messages['export.pdf']}" ajax="false">
<pe:exporter type="pdf" target="searchResult" fileName="export" excludeColumns="0" encoding="ISO-8859-1"/>
</p:menuitem>
<p:menuitem value="#{messages['export.csv']}" ajax="false">
<p:dataExporter type="csv" target="searchResult" fileName="export" excludeColumns="0" encoding="ISO-8859-1"/>
</p:menuitem>
</p:menuButton>
<p:spacer width="10"/>
<h:outputText value="#{fn:length(managePessoaJuridica.manageableList)} #{messages['records.found']}" rendered="#{not empty managePessoaJuridica.manageableList}"/>
</f:facet>
</p:dataTable>
But when I export it, it shows the following
"org.primefaces.component.datalist.DataList#1195cc3" in the pdf and
xls file.
Obviously, Primefaces's data exporter use the toString() method of an object to print its "value(s)".
Suggestions :
Write a custom exporter (recommended)
Override toString() method of org.primefaces.component.datalist.DataList (not advised)
I am using Primefaces 5 with Primefaces Extension 2.0.0 And JSF 2.2 on a Wildfly 8.0.0.
I implemented a datatable using frozenColumns, filtering, pagination as well as multi-select provided by the built in checkboxes.
In most cases the Selected Items are submitted, but not in the following example:
No Items are Selected
Filter the Datatable Content with any Filter field
Select Items
Submit the Form
-> No Selected Items are Submited
Pictures provided in the primefaces Forum
My datatable's xhtml
<h:form id="jobListForm">
<p:panelGrid columns="2" styleClass="no-border">
</p:panelGrid>
<p:panelGrid columns="2" styleClass="no-border">
<p:selectBooleanCheckbox id="showAllTenants" value="#{JobProtocolBean.showAllTenants}" rendered="#{TenantController.isSuperAdmin}">
<p:ajax listener="#{FacesController.refresh}" event="change"/>
</p:selectBooleanCheckbox>
<p:outputLabel for="showAllTenants" value="Show all tenants" rendered="#{TenantController.isSuperAdmin}"/>
</p:panelGrid>
<h:panelGroup>
<mx:tableControls managedBean="#{JobProtocolBean}" />
<p:commandButton icon="ui-icon-arrowreturnthick-1-s" action="#{JobProtocolBean.showExportDialog}" value="Export" ajax="false" rendered="#{Shiro.isPermitted('jobprotocol:list:xmlexport')}" />
<p:dataTable id="JobProtocolTable" widgetVar="JobProtocolTableVar" value="#{JobProtocolBean.items}" binding="#{JobProtocolBean.items.dataTable}" lazy="true"
filteredValue="#{JobProtocolBean.filter}" var="item" paginator="true" rows="10"
currentPageReportTemplate="(Displaying results {startRecord} - {endRecord} of {totalRecords})"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
rowsPerPageTemplate="10,20,50,100,200,500,1000" filterEvent="enter"
selection="#{JobProtocolBean.selectedJobProtocols}"
scrollable="true" scrollWidth="50%" scrollHeight="100%" frozenColumns="2">
<f:event type="preRenderComponent" listener="#{JobProtocolBean.items.preRenderComponent}" />
<p:column id="ACTIONS" headerText="Actions" width="120">
<p:panelGrid columns="4" styleClass="button-column">
<p:commandButton icon="ui-icon-info" action="#{JobProtocolBean.startDetail}" ajax="false" title="Detail" disabled="#{not Shiro.isPermitted('jobprotocol:list:detail')}"/>
<p:commandButton icon="ui-icon-pencil" action="#{JobProtocolBean.startEdit}" ajax="false" title="Edit" disabled="#{not (Shiro.isPermitted('jobprotocol:list:edit') and (item.stateSkipped or item.stateUnplanned))}" />
<p:commandButton icon="ui-icon-copy" action="#{JobProtocolBean.startCopy}" ajax="false" title="Copy" disabled="#{not (Shiro.isPermitted('jobprotocol:list:retry') and item.stateDone and item.cron eq 'onetime')}" rendered="#{item.stateDone}" />
<p:commandButton icon="ui-icon-arrowrefresh-1-e" action="#{JobProtocolBean.startRetry}" ajax="false" title="Retry" disabled="#{not (Shiro.isPermitted('jobprotocol:list:retry') and item.stateSkipped)}" rendered="#{not (item.stateDone or item.stateQueued or item.stateUnplanned or item.statePlanned)}" />
<p:commandButton icon="ui-icon-pause" action="#{JobProtocolBean.startSuspend}" ajax="false" title="Suspend" onclick="return confirm('Do you really want to suspend this job?');" disabled="#{not Shiro.isPermitted('jobprotocol:list:suspend')}" rendered="#{item.statePlanned}" />
<p:commandButton icon="ui-icon-play" action="#{JobProtocolBean.startResume}" ajax="false" title="Resume" onclick="return confirm('Do you really want to resume this job?');" disabled="#{not Shiro.isPermitted('jobprotocol:list:resume')}" rendered="#{item.stateUnplanned}" />
<p:commandButton icon="ui-icon-circle-minus" action="#{JobProtocolBean.startUnqueue}" ajax="false" title="Unqueue" onclick="return confirm('Do you really want to unqueue and re-schedule this job?');" disabled="#{not Shiro.isPermitted('jobprotocol:list:unqueue')}" rendered="#{item.stateQueued}" />
<p:commandButton icon="ui-icon-cancel" action="#{JobProtocolBean.startSkip}" ajax="false" title="Skip" disabled="#{not Shiro.isPermitted('jobprotocol:list:skip') or item.stateDoneOrSkipped}" />
</p:panelGrid>
</p:column>
<p:column selectionMode="multiple" width="18" />
<p:column id="ID" headerText="ID" sortBy="#{item.id}" filterBy="#{item.id}" width="50">
<h:outputText title="#{item.id}" value="#{item.id}"/>
</p:column>
<p:column id="TENANT" headerText="Tenant" rendered="#{JobProtocolBean.showAllTenants}" sortBy="#{item.tenantId}" filterBy="#{item.tenantId}" width="50">
<h:outputText title="#{item.tenantId}" value="#{item.tenantId}" converter="JobTenantConverter"/>
</p:column>
<p:column id="INITIATOR" headerText="Initiator" sortBy="#{item.initiator}" filterBy="#{item.initiator}" width="120">
<h:outputText title="#{item.initiator}" value="#{item.initiator}" />
</p:column>
<p:column id="CODE" headerText="Code" sortBy="#{item.code}" filterBy="#{item.code}" width="300">
<h:outputText title="#{item.code}" value="#{item.code}" converter="JobCodeConverter" escape="false" />
</p:column>
<p:column id="CHANNEL_ID" headerText="Channel ID" sortBy="#{item.channelId}" filterBy="#{item.channelId}" width="150">
<h:outputText title="#{item.channel}" value="#{item.channel}" />
</p:column>
<p:column id="SEQUENCE" headerText="Sequence" sortBy="#{item.orderId}" filterBy="#{item.orderId}" width="65" >
<h:outputText title="#{item.orderId}" value="#{item.orderId}" />
</p:column>
<p:column id="STATE" headerText="State" filterBy="#{item.state}" filterOptions="#{JobProtocolBean.states}" width="80">
<h:outputText value="#{item}" converter="JobStateConverter" />
</p:column>
<p:column id="CRON" headerText="Cron" sortBy="#{item.cron}" filterBy="#{item.cron}" width="70" >
<h:outputText title="#{item.cron}" value="#{item.cron}" />
</p:column>
<p:column id="META" headerText="Meta" sortBy="#{item.meta}" filterBy="#{item.meta}" width="100">
<h:outputText title="#{item.meta}" value="#{item.meta}" />
</p:column>
<p:column id="MIN_FAILURES" headerText="≥ Retries" sortBy="#{item.failures}" filterBy="#{item.failures}" width="60">
<h:outputText title="#{item.failures}" value="#{item.failures}" />
</p:column>
<p:column id="BUSINESS_ERROR" headerText="Failure" sortBy="#{item.errorCode}" filterBy="#{item.errorCode}" width="80">
<h:outputText title="#{item.errorCode}" value="#{item.errorCode}" />
</p:column>
<p:column id="SKIP_REASON" headerText="Skip Reason" sortBy="#{item.skipReason}" filterBy="#{item.skipReason}" width="80">
<h:outputText title="#{item.skipReason}" value="#{item.skipReason}" />
</p:column>
<p:column id="TIME_STORED" sortBy="#{item.timeStored}" width="120">
<mxtaglib:dateFilter dateProperty="#{item.timeStored}" datePropertyName="timeStored" headerText="Time Stored" tableBinding="#{JobProtocolBean.items}"/>
</p:column>
<p:column id="PLANNED_START" sortBy="#{item.nextPlannedStart}" width="120">
<mxtaglib:dateFilter dateProperty="#{item.nextPlannedStart}" datePropertyName="nextPlannedStart" headerText="Planned Start" tableBinding="#{JobProtocolBean.items}"/>
</p:column>
<p:column id="TIME_QUEUED" sortBy="#{item.timeQueued}" width="120">
<mxtaglib:dateFilter dateProperty="#{item.timeQueued}" datePropertyName="timeQueued" headerText="Time Queued" tableBinding="#{JobProtocolBean.items}"/>
</p:column>
<p:column id="TIME_STARTED" sortBy="#{item.timeStarted}" width="120">
<mxtaglib:dateFilter dateProperty="#{item.timeStarted}" datePropertyName="timeStarted" headerText="Time Started" tableBinding="#{JobProtocolBean.items}"/>
</p:column>
<p:column id="TIME_DONE" sortBy="#{item.timeDone}" width="120">
<mxtaglib:dateFilter dateProperty="#{item.timeDone}" datePropertyName="timeDone" headerText="Time Done" tableBinding="#{JobProtocolBean.items}"/>
</p:column>
</p:dataTable>
<p:outputPanel styleClass="ui-paginator-inline-span">
<p:selectOneMenu id="ACTION_SELECTOR" value="#{JobProtocolBean.selectedAction}" >
<f:selectItems value="#{JobProtocolBean.accessibleActions}" itemValue="#{JobProtocolBean.accessibleActions.value}" />
</p:selectOneMenu>
<p:commandButton id="ACTION_BUTTON" action="#{JobProtocolBean.startActionSelected}" ajax="false" value="OK" />
</p:outputPanel>
<mxtaglib:blockUI block="JobProtocolTable" trigger="JobProtocolTable" styleClass="block-ui" />
</h:panelGroup>
</h:form>
I found the origin of the described bug:
The Javascript Object for datatables with frozenColumns provides a function to copy the 's reveived by an ajax request like in sort, filter etc.
This function doesn't take care of the 'rk' value which is saved in the data (jQuery data()) of the .
Original:
copyRow: function(original) {
return $('<tr></tr>').data('ri', original.data('ri')).addClass(original.attr('class')).attr('role', 'row');
};
My Workaround:
PF(datatableUtils.datatableWidgetVar).copyRow = function(original) {
return $('<tr></tr>').attr('data-ri', original.data('ri')).attr('data-rk', original.data('rk')).addClass(original.attr('class')).attr('role', 'row');
};
writing the data with attr() and the 'data-' prefix is necessary as it seems to lose the stored data as the tr is not yet attached. (I honestly didn't follow this one to the end so correct me if I'm wrong with this)