aspose file tools
The moose likes JSF and the fly likes Page not getting submitted if my text box is not part of backing bean... Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSF
Reply Bookmark "Page not getting submitted if my text box is not part of backing bean..." Watch "Page not getting submitted if my text box is not part of backing bean..." New topic
Author

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

Shasi Mitra
Ranch Hand

Joined: Nov 27, 2008
Posts: 101

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

Joined: Dec 28, 2006
Posts: 893
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.




Remko (My website)
SCJP 1.5, SCWCD 1.4, SCDJWS 1.4, SCBCD 1.5, ITIL(Manager), Prince2(Practitioner), Reading/ gaining experience for SCEA,
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
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.


Code depot of a Java EE / JSF developer | JSF / Eclipse / Tomcat kickoff tutorial | DAO kickoff tutorial | I ♥ Unicode
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
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.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel
 
subject: Page not getting submitted if my text box is not part of backing bean...
 
Similar Threads
Issue with t:alias using JSF Ajax tomahawk
How to get the bean object in servlet from jsp?
InputText in DataTable does not store value
Rendering database loaded pojo the first time.
Inputfield in ui:repeat