• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Postback OutputText Binding Failed

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Saloon Keeper
Posts: 24305
167
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic