jsf - How to add Cell Edit by click or edit single column in Datatable using Primefaces 3.4.2 -
i'm using primefaces 3.4.2 , due restrictions can't update latest version. have add edit option column "contact" in datatable in below code user can edit , update it.
i tried using primefaces inplace , row editing (only single column) takes ages submit when clicked on save or cancel button.
can me this?
thank in advance.
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.org/ui"> <p:dialog id="viewsiteshistoricalarm" header="alarm information" widgetvar="viewsitehistoricalmdialog" modal="false" minwidth="930" minheight="600" fixedcenter="false" appendtobody="true" effect="fade" effectduration="0.5" close="true" closelistener="#{historicactivity.dlgclose}"> <h:form id="viewsitehistoricalmfrm"> <h:panelgrid columns="1" style="margin:5px;" id="printid"> <p:datatable id="alarmresolution" var="alm" value="#{historicactivity.alarmresolution}" style="border-right-width: 2px !important;overflow: -moz-scrollbars-vertical;overflow-x: auto;overflow-y: auto; width:895px;max-height:500px !important;" paginatorposition="top" paginatortemplate="{previouspagelink} {currentpagereport} {nextpagelink}" editable="true" rows="100" paginatoralwaysvisible="false"> <p:ajax event="rowedit" listener="#{historicactivity.updatecontactname}" /> <p:column style="width:155px"> <f:facet name="header"> <h:outputtext value="action time"/> </f:facet> <h:outputtext value="#{alm.timeactioned}"/> </p:column> <p:column > <f:facet name="header"> <h:outputtext value="user"/> </f:facet> <h:outputtext value="#{alm.user}"/> </p:column> <p:column style="width:140px" > <f:facet name="header"> <h:outputtext value="action"/> </f:facet> <h:outputtext value="#{alm.action}"/> </p:column> <p:column style="width:140px" > <f:facet name="header"> <h:outputtext value="contact"/> </f:facet> <h:outputtext value="#{alm.alm.contactname}"/> </p:column> <p:column> <f:facet name="header"> <h:outputtext value="comments"/> </f:facet> <h:outputtext value="#{alm.comments}"/> </p:column> <p:column headertext="modify"> <p:roweditor /> </p:column> </p:datatable> <p:toolbar> <p:toolbargroup align="left"> <p:commandbutton value="csv" ajax="false" style="color:#a8a6a8!important;"> <p:dataexporter type="csv" target="alarmresolution" filename="historicalarminfo" preprocessor="#{exporter.preprocessor}" postprocessor="#{exporter.postprocessor}"/> </p:commandbutton> <p:commandbutton value="pdf" style="color:#a8a6a8!important;" update="viewsitehistoricalmfrm" onstart= "pdfdownloaddialog.show();" rendered="#{historicactivity.val==true}"> <f:setpropertyactionlistener target="#{pdfexp.columnvalues}" value="#{historicactivity.exptrcolvalsalmspecific}"/> <f:setpropertyactionlistener target="#{pdfexp.tabcolumnswithsize}" value="#{historicactivity.exptrspecificalmcol}"/> <f:setpropertyactionlistener target="#{pdfexp.headercontent}" value="#{historicactivity.exptrheaderalmspecific}"/> <f:setpropertyactionlistener target="#{pdfexp.logo}" value="#{historicactivity.exptrheaderlogo}"/> <f:setpropertyactionlistener target="#{pdfexp.pagetitle}" value="#{historicactivity.exptrpgtitle}"/> <f:setpropertyactionlistener target="#{pdfexp.filename}" value="#{historicactivity.exptrfilename}"/> <f:setpropertyactionlistener target="#{pdfexp.redirectto}" value="historicactivitypage?faces-redirect=true"/> </p:commandbutton> <p:commandbutton value="pdf" style="color:#a8a6a8!important;" actionlistener ="#{historicactivity.checkhistoricsitealmssize}" update="viewsitehistoricalmfrm" rendered ="#{historicactivity.val==false}"/> <p:commandbutton value="xls" ajax="false" style="color:#a8a6a8!important;"> <p:dataexporter type="xls" target="alarmresolution" preprocessor="#{exporter.preprocessor}" postprocessor="#{exporter.postprocessor}" filename="historicalarminfo"/> </p:commandbutton> </p:toolbargroup> </p:toolbar> </h:panelgrid> </h:form> </p:dialog> </ui:composition>
Comments
Post a Comment