File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes how to acces backingBean from popup Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "how to acces backingBean from popup" Watch "how to acces backingBean from popup" New topic

how to acces backingBean from popup

Floricel Andrei

Joined: Nov 06, 2009
Posts: 5
Hello. I'm new into JSF, and I already have a problem
I display a list(using a DataTable).When I press the Upload Button, a popup windows appears, containing a form, where I fill in the data.In the backingBean of the popup I create an Object from the readed data. This far everything is good.
Now I don't know how to pass this Object to my list, which is in the Backing Bean of the MainWindow.
I hope I was clear, I know my english is perfectible...

Christian Nicoll
Ranch Hand

Joined: Mar 09, 2008
Posts: 106
Hi Andrei,

i'm also quite new to Faces. My first thought is to define a link between your both backing beans over the faces-config.xml, where you create in one <managed-bean> an sub-element <managed-property> which references your popup-backing bean.

Best regards,

My SCBCD-Notes - My Hello World Webservice
Samuel March
Ranch Hand

Joined: Oct 28, 2009
Posts: 39
Just use the usual declarations for a JSF page for the popup and the usual path configuration for JSF if its simply a call to"some-jsf-path-to-page","_blank");

If you mean a dynamically javascript produced popup including the information through the javascript, the difficulty will be retrieving the information which would need to be printed into the original JSF page by a request, or you can test the form page values and copy the id's given to the elements which will remain the same something like id="pageaddedside:element1" and use that set of id's in your script.

...did you have the fish?!............................ No.
Floricel Andrei

Joined: Nov 06, 2009
Posts: 5
I'm not sure I understood you

In first.jsf I have

In I have:

and my popupWindow.jsf

I know, maybe the design is not the best, maybe I could have done it better, but as I sayed, I'm new with Jsf and with JavaEE also
Any suggestions and advices would be appreciated.Thanks

L.E. Ok, my fault, I didn't look enough on the google
I've done it by injecting the managed Bean into the other, like here

Now I have a question, how to I rerender the mainWindow, to update the display of the list?Thanks
Floricel Andrei

Joined: Nov 06, 2009
Posts: 5
Ok, I'm eally stuck with this...How can I force the refresh of the parent window, after I submit the popup window?
I would do this:
but jsf messes with the id's.
Also, when I try this

it refreshes the parent windows, but it opnes the popup also...
Thank you
Floricel Andrei

Joined: Nov 06, 2009
Posts: 5
Done that also, by calling from the popUpHandler
I agree. Here's the link:
subject: how to acces backingBean from popup
It's not a secret anymore!