Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

calling action functions from different beans  RSS feed

 
atieq rehman
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how can i call functions from different managed bean than the one current page is being bound to???

like i have a page to create a user. and to make address populated i have stateBean having functions populateStateCombo and populateCityCombo. on change of state combo i want to call populateCityCombo that uses currently selected state.

these functions are written in stateBean that is differnt from userBean which is bound to my current page. populateCityCombo is called using a4j:support bt selected state id is missing.. how to pas selected state id to get list of desired cities ...

thanks in advance
 
Tim Holloway
Bartender
Posts: 18705
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A JSF page is not bound to a single backing bean. If it was, there would have been no need to supply the bean ID as part of the EL in value references. You can reference as many different backing beans in a JSF View as you like, and contra-wise, a backing bean may be referenced by multiple JSF views. It's up to you to co-ordinate the communications between the beans, however.

It's entirely permissible to create a logic-only backing bean. I have one or two of those myself. They supply methods that don't need any stateful backing data.
 
atieq rehman
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ya you are right and i also have the same concept but the issue is i m unable to pass some parameter from current page to some other bean that is not bound to this page, to fetch required data..

my question was how can i pass parameter or current selected information to that bean to get the desired results. it may be a4j call


thanks in advance
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!