java - Input given in JSF page does not set that value to manged bean variable -


am newbie jsf. using jsf 2 , primeface 4.0 in application. stated in title, input value given in xhtml page, not set value managedbean. have tried possible combination. appreciated.

growlmessage.xhtml

<html xmlns="http://www.w3.org/1999/xhtml"       xmlns:h="http://java.sun.com/jsf/html"       xmlns:p="http://primefaces.org/ui">     <h:head>      </h:head>     <h:body>     <h:form>    <p:growl id="growl" showdetail="true" sticky="true" />        <p:panel id="panelid" header="growl">           <h:panelgrid columns="2" cellpadding="5">               <h:outputlabel for="msg" value="message:" />                <p:inputtext id="msg" value="#{growlview.message}" required="true" />           </h:panelgrid>         <p:commandbutton value="save" actionlistener="#{growlview.savemessage}"/>       </p:panel>      </h:form>       </h:body> </html> 

` growlview.java:

import java.io.serializable; import javax.faces.application.facesmessage; import javax.faces.bean.managedbean; import javax.faces.bean.viewscoped; import javax.faces.context.facescontext;   @managedbean @viewscoped public class growlview implements serializable{      private string message;      public growlview() {     }      public string getmessage() {         return message;     }      public void setmessage(string message) {         this.message = message;     }       public void savemessage(){         system.out.println("@@@@@  hello");         system.out.println("@@@@@"+ getmessage());         facescontext context = facescontext.getcurrentinstance();         context.addmessage(null, new facesmessage("successful", "your message: "+message));         context.addmessage(null, new facesmessage("second message", "additional message details"));      }    } 

your commandbutton should (according primefaces showcase):

<p:commandbutton value="save" actionlistener="#{growlview.savemessage}" update="growl"/> 

have tried setting larger scope managed bean, example @sessionscoped ? (just testing purposes). exclude possible scope problem.


Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -