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

calling action functions from different beans

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic