Thanks. It works now.
Matt 

-----Original Message-----
From: Volker Weber [mailto:[EMAIL PROTECTED] 
Sent: Mittwoch, 14. September 2005 14:47
To: MyFaces Discussion
Subject: Re: Form data passing problem

Hi,

you must remove the immediate="true" form your submit button!

this skips the updatemodel phase.

Matthias Klein wrote:
> I have written a simple JSF-page which contains only one single inputText:
> 
> <%@ taglib uri="http://java.sun.com/jsf/html"; prefix="h" %> <%@ taglib 
> uri="http://java.sun.com/jsf/core"; prefix="f" %>
> 
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
>       
> <f:view>
>       <f:loadBundle
> basename="ca.gc.nrc.iit.toml.frontend.bundles.RateCourse"
> var="MessageBundle"/>
>       <html>
>               <head>
>                       <link href="css/stylesheet.css" rel="stylesheet"
> type="text/css"/>
>                       <title>
>                               <h:outputText
> value="#{MessageBundle.dialogtitle}" />
>                       </title>
>               </head>
> 
>               <body>
>                       <h:form id="RateCourseForm">
>                       <h:panelGrid id="grid" columns="4">
>                                       <h:outputText
> value="#{MessageBundle.dialogtitle}" />
>                                       <h:inputText id="test"
> value="#{RateCourseBackingBean.evaluation}" required="true" />
> 
>                                       <h:commandButton id="submit"
> action="#{RateCourseBackingBean.submit}"
> value="#{MessageBundle.submitbuttonlabel}" immediate="true" />
>                                       <h:commandButton id="cancel"
> action="#{RateCourseBackingBean.cancel}"
> value="#{MessageBundle.cancelbuttonlabel}" immediate="true" />
>                               </h:panelGrid>
>                       </h:form>
>               </body>
>       </html>
> </f:view>
> 
> 
> The Backing Bean looks like
> 
> package ca.gc.nrc.iit.toml.frontend;
> 
> //import javax.faces.model.*;
> 
> public class RateCourseBackingBean {
>       
>       private String evaluation = "test";
> 
>       public String submit() {
>               System.out.println(this.evaluation);
>               return "submit";
>       }
>       
>       public String cancel() {
>               return "cancel";
>       }
> 
>       public String getEvaluation() {
>               return evaluation;
>       }
> 
>       public void setEvaluation(String evaluation) {
>               this.evaluation = evaluation;
>       }
> }
> 
> It works so far but the System.out.println() in submit() only ever 
> prints "test" on the console.
> 
> And I don't know why.
> 
> Did I make a mistake in the nesting of the tags of the JSF-page?
> (What is the official nesting of elements? The JSF-Spec does not seem 
> to state what an empty JSF-page should look like and how the elements 
> are to be
> nested.)
> 
> Do you have any idea where that mistake is?
> 
> Thanks
> 
> Matt
> 

--
-------------------------------------------------------------------------
    Volker Weber    Dietrichsweg 38a     26127 Oldenburg     Germany
    MAILTO:[EMAIL PROTECTED]   HTTP://www.weber-oldenburg.de


Reply via email to