• 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

how to acces backingBean from popup

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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...

 
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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,
Christian
 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
window.open("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.
 
Floricel Andrei
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not sure I understood you:)

In first.jsf I have


In msPopupHandler.java 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
http://balusc.blogspot.com/2006/06/communication-in-jsf.html#InjectingManagedBeansInEachOther

Now I have a question, how to I rerender the mainWindow, to update the display of the list?Thanks
 
Floricel Andrei
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Done that also, by calling from the popUpHandler
 
reply
    Bookmark Topic Watch Topic
  • New Topic