spring - Does not work message. Primefaces -
i use next page. , method of managedbean works, not show message:
<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:p="http://primefaces.org/ui" xmlns:f="http://java.sun.com/jsf/core" template="/templates/template.xhtml"> <ui:define name="metadata"> </ui:define> <ui:define name="content"> <h:body> <h:form id="form"> <p:growl id="msgs1" showdetail="true" /> <!-- <p:outputlabel rendered="#{projectbean.before}" value="registration not open yet"/> <p:outputlabel rendered="#{projectbean.after}" value="registration closed"/> <p:panel header="#{msg['createproject']}" id="panel" rendered="#{projectbean.checkdate}">--> <p:panel header="#{msg['createproject']}" id="panel" > <h:panelgrid columns="3" cellpadding="7" id = "panelgrd"> <h:outputlabel for="name" value="#{msg['name']}*" style="width:100px"/> <p:inputtext id="name" value="#{project.name}" label="#{msg['name']}" style=" padding: 10px; width:400px" validatormessage="name - please input english letters, digits only" required="true"> <f:validateregex pattern="^[a-za-z\s\d]+$" /> </p:inputtext> <p:message for="name" display="icon" /> <h:outputtext value=" " /><h:outputtext value=" " /><h:outputtext value=" " /> <h:outputlabel for="meta" value="#{msg['meta']}*" /> <p:inputtext id="meta" value="#{project.meta}" label="#{msg['meta']}" style=" padding: 10px; width:400px" validatormessage="meta - please input english letters, digits only" required="true"> <f:validateregex pattern="^[a-za-z\s\d]+$" /> </p:inputtext> <p:message for="meta" display="icon" /> <h:outputtext value=" " /><h:outputtext value=" " /><h:outputtext value=" " /> <h:outputlabel for="des" value="#{msg['description']}*" /> <p:inputtextarea rows="5" cols="30" id="des" counter="display" maxlength="250" countertemplate="{0} #{msg['charactersremaining']}." value="#{project.description}" label="#{msg['description']}" autoresize="false" style=" padding: 10px; width:400px " validatormessage="description - please input english letters, digits only" required="true"> <f:validateregex pattern="^[a-za-z\s\d]+$" /> </p:inputtextarea> <p:message for="des" display="icon" /> <h:outputtext value=" " /><h:outputtext id="display" /><h:outputtext value=" " /> <h:outputtext value=" " /><h:outputtext value=" " /><h:outputtext value=" " /> <h:outputlabel for="amount2" value="#{msg['sphere']}" /> <p:selectonemenu id="amount2" value="#{project.sphere}" label="#{msg['sphere']}" style="width:400px"> <f:selectitems value="#{enumvaluesprovider.spheres}" var="sphere" itemvalue="#{sphere}" itemlabel="#{sphere.name}"/> </p:selectonemenu> <h:outputtext value=" " /> <h:outputtext value=" " /><h:outputtext value=" " /><h:outputtext value=" " /> <h:outputlabel for="pattern" value="#{msg['manager']}*" /> <p:inputtext id="pattern" value="#{project.manager}" label="#{msg['manager']}" style=" padding: 10px; width:400px" validatormessage="manager - please input english letters, digits only" required="true"> <f:validateregex pattern="^[a-za-z\s\d]+$" /> </p:inputtext> <p:message for="pattern" display="icon" /> <h:outputtext value=" " /><h:outputtext value=" " /><h:outputtext value=" " /> <h:outputlabel for="checked" value="#{msg['team']}" /> <p:inputtext id="checked" value="#{project.team}" style=" padding: 10px; width:400px" validatormessage="team - please input english letters, digits only" > <f:validateregex pattern="^[a-za-z\s\d]+$" /> </p:inputtext> <p:message for="checked" display="icon" /> <h:outputtext value=" " /><h:outputtext value=" " /><h:outputtext value=" " /> <h:outputtext value=" " /> <p:commandbutton value="#{msg['save']}" ajax="false" icon="ui-icon-check" validateclient="true" actionlistener="#{projectbean.addproject}" style="left: 312px;" > </p:commandbutton> </h:panelgrid> </p:panel> </h:form> </h:body> </ui:define>
method:
public void addproject(){ facesmessage message = new facesmessage(facesmessage.severity_info, "you voting saved", "thank you chose"); requestcontext.getcurrentinstance().showmessageindialog(message); }
i think problem in panel or panelgrid. on other hand, method work possition. please me issue
i found reason. - ajax="false". delete it, , message shown
Comments
Post a Comment