Get your CodeRanch badge!*
The moose likes JSF and the fly likes Postback OutputText Binding Failed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Postback OutputText Binding Failed" Watch "Postback OutputText Binding Failed" New topic
Author

Postback OutputText Binding Failed

Johnny Lui
Greenhorn

Joined: Mar 27, 2013
Posts: 1
Test Case 1

MyBean.java



index.xhtml



Result:

Console shows the process function successfully obtain the var1 value from inputText
But browser shows blank outputText.
Nevertheless the inputText value contains correct var1 value when I view source in browser.


Test Case 2

modify MyBean.java



page2.xhtml



Result:

Both console and browser shows var1 value.


Question:

Does JSF support postback to same page? The answer is no according to my tests.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15630
    
  15

Postback is, by definition, posting back (to the same page). But I don't see a scope definition on myBean. My suspicion is that myBean is being created at Request scope, meaning that the bean is created and destroyed on each URL request.

If you want the value to carry over, you need at least the View Scope level. Request scope isn't quite useless in JSF, but there are not many uses for it.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
 
subject: Postback OutputText Binding Failed
 
Similar Threads
Facelets template/composition without name atribute
JSF 2.0 Login
Issue with my webApp
Composite Components Problem
problem with new user