• Post Reply Bookmark Topic Watch Topic
  • New Topic

Nested Backing Bean

 
rudresh kumar
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi all,

I have a issue with populating backing bean details.

a) I have customer jsf, which is backed by customer.bean (request scope), this bean has a reference to result.bean (which has the results of the credit card validation, let us say approved (allowable yes/no).

Customer class

String name;
String userId;
Result result;

public String validateCustomer() {
//biz logic
result = new Result();
result.setApproved(Y/N);
return "mapping" (result.jsf)
}
on the result.jsf
<hutputFormat styleClass="outputText" value="#{msg.outputpgdisp}">
<f:param value="#{result.approved}"></f:param>
</hutputFormat>

This always gives null, can i know which i am facing this issue.
both the backing bean are request scope

Thanks
 
Tim Holloway
Bartender
Posts: 18413
58
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you should have been saying:



Otherwise JSF will construct a whole new Result bean separate from the one in the Customer bean - unless you injected it into the Customer bean as a managed property.

Request-scope objects have a very short lifetime, though, so it's best when you're unsure or have problems to use session scope. Then when everything's working you feel brave, you can change the scope.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!