css3 - JSF Primefaces reload issue, could this be CSS issue or any other? -
in our web project use jsf myfaces, primefaces 3.5. have created our own primefaces theme project.
i find following odd problems, suspect due css/library etc,
multiple selection checkbox on p:datatable works on odd tries. i.e on first load of page selection works. if visit 1 other page , comeback, select check box doesn't work. if visit 1 more page , comeback works again. when doesn't work, if page reload browser works again. (the problem same in browsers)
p:ajaxstatus onstart js function fires first ajax call. subsequent calls event not fired. if reload page again fires first ajax call , stops. have not set global setting on ajax calls, presume calls default global = true (the problem same in browsers)
for p:barchart on chrome, x , y-axis labels fall in axis, when reload page display adjusted , correct (as appears in firefox), , no further reload need during session, when navigate , forth other pages.
our application has menu area on top , ouputpanel updated using ui:include based on ajax menu selection.
i not sure causing these issues, , why things seem work fine on reload. problem be?
the view code first issue related multiple selection checkbox below.
<?xml version="1.0" encoding="iso-8859-1" ?> <!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> <html 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" xmlns:c="http://java.sun.com/jsp/jstl/core"> <h:head> </h:head> <h:body> <h:form id="dataform"> <p:messages id="tablemsgs" /> <h:panelgroup> <p:datatable value="#{usersbean.userdatamodel}" var="user" id="userdatamodel" rows="20" paginator="true" paginatoralwaysvisible="false" editable="true" selection="#{usersbean.selectedusers}" resizablecolumns="false"> <f:facet name="header"> <p:commandbutton value="flag user" process="@form" action="#{usersbean.flaguser}" icon="ui-icon-custom-arrow" iconpos="right" update=":dataform:tablemsgs"></p:commandbutton> <p:spacer width="10"></p:spacer> <p:commandbutton value="delete user" process="@form" icon="ui-icon-custom-arrow" iconpos="right" update="@form" action="#{usersbean.deleteuser}"> </p:commandbutton> </f:facet> <p:ajax event="rowedit" listener="#{usersbean.onedit}" oncomplete="resetcss()" update=":dataform:tablemsgs /> <p:ajax event="roweditcancel" oncomplete="resetcss()" /> <p:column selectionmode="multiple" style="width:15px;" /> <p:column headertext="department" sortby="#{user.dept.name}" style="white-space:pre-line;width:100px"> <h:outputtext value="#{user.dept.name}" style="white-space:pre-line;width:100px;display:block;"> </h:outputtext> </p:column> <p:column headertext="username" sortby="#{user.userloginname}" style="width:100px;"> <h:outputtext value="#{user.userloginname}" style="width:100px;display:block;"></h:outputtext> </p:column> <p:column headertext="role" sortby="#{user.role}" style="width:100px;"> <p:celleditor> <f:facet name="output"> <h:outputtext value="#{user.role}" style="width:100px;display:block;"></h:outputtext> </f:facet> <f:facet name="input"> <p:selectonemenu value="#{user.role}" style="width:95px" rendered="#{user.enabled eq true}" > <f:selectitems value="#{usersbean.rolesmap[user.dept.deptid]}" var="role" itemlabel="#{role}" itemvalue="#{role}"></f:selectitems> </p:selectonemenu> <h:outputtext value="#{user.role}" rendered="#{user.enabled eq false}"/> </f:facet> </p:celleditor> </p:column> <p:column headertext="manager" style="width:100px;"> <p:celleditor> <f:facet name="output"> <h:outputtext value="#{user.usermanagerbyuserid.userbymanagerid.userloginname}" style="width:100px;display:block;"></h:outputtext> </f:facet> <f:facet name="input"> <p:selectonemenu rendered="#{user.enabled eq true}" value="#{usersbean.manageridmap[user.userid]}" style="width:95px;"> <f:selectitems value="#{usersbean.managermap[user.dept.deptid]}" var="manager" itemlabel="#{manager.userloginname}" itemvalue="#{manager.userid}"></f:selectitems> </p:selectonemenu> <h:outputtext value="#{user.usermanagerbyuserid.userbymanagerid.userloginname}" rendered="#{user.enabled eq false}"/> </f:facet> </p:celleditor> </p:column> <p:column headertext="email" style="width:100px;"> <p:celleditor> <f:facet name="output"> <h:outputtext value="#{user.email}" style="width:100px;display:block;"></h:outputtext> </f:facet> <f:facet name="input"> <p:inputtext value="#{user.email}" style="width:95px;" validatormessage="enter valid email" maxlength="100"> <f:validateregex pattern="^[_a-za-z0-9-\+]+(\.[_a-za-z0-9-]+)*@[a-za-z0-9-]+(\.[a-za-z0-9]+)*(\.[a-za-z]{2,})$" /> </p:inputtext> </f:facet> </p:celleditor> </p:column> <p:column headertext="last login" style="width:60px;"> <h:outputtext value="#{user.lastlogin}" style="width:60px;display:block;"> <f:convertdatetime pattern="dd/mm/yyyy"></f:convertdatetime> </h:outputtext> </p:column> <p:column headertext="status" style="width:40px;"> <p:celleditor> <f:facet name="output"> <h:outputtext value="enable" rendered="#{user.enabled eq true}"></h:outputtext> <h:outputtext value="disable" rendered="#{user.enabled eq false}"></h:outputtext> </f:facet> <f:facet name="input"> <p:selectbooleancheckbox value="#{user.enabled}" /> </f:facet> </p:celleditor> </p:column> <p:column headertext="locked" style="width:40px;"> <p:celleditor> <f:facet name="output"> <h:outputtext value="locked" rendered="#{user.locked eq true}" style="width:40px;display:block;" /> <h:outputtext value="unlocked" style="width:40px;display:block;" rendered="#{user.locked eq false}"></h:outputtext> </f:facet> <f:facet name="input"> <p:selectbooleancheckbox value="#{user.locked}" /> </f:facet> </p:celleditor> </p:column> <p:column headertext="edit" style="width:30px;"> <p:roweditor> </p:roweditor> </p:column> </p:datatable> </h:panelgroup> </h:form> </div>
Comments
Post a Comment