aspose file tools*
The moose likes JSF and the fly likes Problem with apply request values phase Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Problem with apply request values phase" Watch "Problem with apply request values phase" New topic
Author

Problem with apply request values phase

Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Hey folks,

My application is going great. The problem occurs, when I disable any of the input field in the html form due to any reason, say through javascript dynamically. Now as request processing life cycles says:

Restore View ----- > Apply Request Values

Its fine but I am getting the disabled field as null. I want the previous value of the field if the field is disabled in its current state.

Moreover, some of my .NET mates told me that in ASP.NET its simple and straight. If some field becomes disabled then the previous value is treated. And saying something about viewState stuff. I am not at all familiar with ASP.NET.

Do we have something to handle this within the JSF? Any solution with in the framework?

Please help me out, as I am new to JSF and its not really handy to me.
Varun Khanna
Ranch Hand

Joined: May 30, 2002
Posts: 1400
Disabled fields aren't submitted as JSF doesn't feels the need of storing "read-only" fields at the server side and probably rightly so?

One of the alternate approach would be doing it in an old JSP way by using hidden variables (i.e. JSF hidden variables)

Another bad approach would be to let the state be non-disabled at the server side and in UI let javascript disable it during onload of page and while submitting enable it back :roll:


- Varun
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874

Disabled fields aren't submitted as JSF doesn't feels the need of storing "read-only" fields at the server side and probably rightly so?


readonly is working like charm. disabled is not working .
Varun Khanna
Ranch Hand

Joined: May 30, 2002
Posts: 1400
Oops, by "readonly" I meant non-EditableValueHolder and disabled components. I didn't mean component with readonly attribute set as true.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with apply request values phase