Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Page not getting submitted if my text box is not part of backing bean...

 
Shasi Mitra
Ranch Hand
Posts: 101
Flex Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is a problem having the mapping variable for an input text box as part of the Value object which is part of the backing bean. The page does not get submitted on clicking the submit button. Instead the same page gets refreshed.

The jsf code for the input text box is as follows
<t:inputText id=”confirm” value = “#{backing bean.valueobject.inputtext}”></t:inputText>

But when I have the mapping variable ‘inputtext ’ as part of the backing bean it works fine.

The question is - Can’t we have the mapping variable for an input field as a part of the value object which is a part of the backing bean.
 
Remko Strating
Ranch Hand
Posts: 893
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it could work if you have a method in your backingbean like

getValueobject() which returns the Valueobject

Within the valueobject you need to have a method like

getInputtext() which returns the inputtext.



 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Shasi Mitra wrote:Instead the same page gets refreshed.

Have you read the appserver logs? The answer should be in there. In case of JSF 1.1 or older, add a <h:messages> to the page to get notified of any uncaught validation and conversion errors.

My cents on that your bean is request scoped and that you didn't preinstantiate the reference behind the 'valueobject' property.
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Remko Strating wrote:it could work if you have a method in your backingbean like

getValueobject() which returns the Valueobject

Within the valueobject you need to have a method like

getInputtext() which returns the inputtext.



The problem is not getting of the value. The problem is the setting of the value.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic