Hi, the problem is immediate="true" on the submit commandButton. If you add this option the "properties sets step" and "validations step" are skiped and the action is executes immediatly.
 
I hope this help you
Nicola

 
On 9/14/05, Matthias Klein <[EMAIL PROTECTED]> 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="" 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="" }"
value="#{MessageBundle.submitbuttonlabel}" immediate="true" />
                                       <h:commandButton id="cancel"
action="" }"
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


Reply via email to