• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

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

 
Ranch Hand
Posts: 101
Spring Flex Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 893
Tomcat Server Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.



 
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic