• 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
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Quick question about reading a Bean reading a JSF inputLabel

 
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a registration page which forwards to a confirm page, how can I get my RegistrationBean to grab the values of my outputLabels

example:-
<h: outputText value="#{reg.email}" />

@managedBean(name="reg"
...

private String email
getEmail/setEmail

I keep getting 'null', so I guess I shouldn't be using a h: outputText, but what should I be using?
The only other thing I can think to do is add a inputHidden for each param in my confirmation page:
e.g: <h:inputHidden name="email" id="email" value="#{reg.email}" />

Saying that, why has my Bean lost the values for firstname, surname etc yet it is able to display them in the JSF page?

Here is the code for viewing:-

Enter Details page:


Confirm page:


Bean:


Cheers

KS
 
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Keith,

I have't use facelets much and I don't know nothing about the FacesContextManager (class/interface ? - Do you have further infos?), but I would assume that the forward and/or redirect method of FacesContextManager can be a problem.

I had assumed that you return a String in your confirm()-method and then over the specific navigation-rule in your faces-config.xml do the forward to your result page. Why don't you use this common approach?

You 've bind your bean "reg" only on the request-scope. I'm not sure that this FacesContextManager takes care that your request-values from your input page are also available in your result page. You can also try it out to bind your managed bean at the session scope, does you still get a null value?

Best regards,
Christian
 
And then we all jump out and yell "surprise! we got you this tiny ad!"
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic