ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  Handling Events in JavaServer Faces, Part 2
Subject:   not WORKING
Date:   2006-01-05 10:05:47
From:   mohammad_gh
hi


i read your article and i writed an example
that works mysterious.


i have a jsp file with a <h:commandButton> that its action is
to change the value of another property named desc that
<h:inputText id="desc"> is bound to.


the jsp file contain:



<h:inputText id="desc" value="#{mywork.desc}" required="true">
<h:commandButton value="Cooperation Test" action="#{mywork.testOther}" />


<c:out value="${mywork.desc}"/>


mywork is an instance of Work class with the method testOther() like this:



public String testOther() {


setDesc("new "+getDesc());


return "success";
}


the jsp <c:out > tag is used to view behind the scene.
the button change the value of 'desc' textbox and everything goes
well until i want to set immediate="true" in the commnadButton then the
'desc' <h:inputText> does not show the new vlaue("new"+ old value )
but the jsp tag show it correclty.


why the value of rthe inputext is not shown correclty,in the render outoput
the binding expression must be revaluated and check getDesc() methode.


in your book in chapter 8 and in section
8.3 Handling User Interface Events
Example 8-4. Entry form area JSP page with a button for extending the type choices (expense/stage3/entryFormArea.jsp)
or this article
do the same thing but with diffrent component.
it use a select and i use a textbox but why it does not work like expected.


thank u from your help.