• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

Execute backing bean method on another page?

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all
I would appreciate any suggesstions on the following scenario. I have the following.

Page 1:
Command Button

Page 2:
OutputText
OutputText2
PrePopulateFields()

When a user presses the command button on page 1 I wish to execute PrePopulateFields() and then direct the user to that page or redirect the user then call PrePopulateFields(); I'm not fussy so long as the fields displayed are updated.

Can anyone tell me whether this is possible and how to do it.

Thanks in advance
Kris.
[ June 26, 2008: Message edited by: Bear Bibeault ]
 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is the Command Button's action listener in the same Backing Bean as "PrePopulateFields" function? If so, just call the function in the command button's action listener's function. If they are in separate Backing Beans (I don't why it should be), take the instance of the BB from the faces context and execute the function.

I hope I understood the question correctly.
 
Saloon Keeper
Posts: 25656
183
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
I also am unclear.

You can have one backing bean reference another backing bean by using the faces-config file to inject the referenced bean into the referencing bean.

However, if you're expecting to click a button in one web browser window or tab and have the properties updated in another window or tab, that's not possible. JSF is using HTTP and HTTP requires that all responses come back to the same place that the request came from.
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic