• 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Could i close richfaces popup panel from manage Bean?

 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys,,
i've been searching tutorial for closing rich:popup panel from manage bean
but i didnt found at all

any of you guys know how could i close rich:popup from manage bean?


any help will be appreciated

thanks in advance
 
Saloon Keeper
Posts: 28069
198
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
You can't. No web application can send data to a client unless the client has made a request. Only one response may come back from one request. Webapps (whether Java or not) are not independently running programs, they're bundles of code that get called to process a request and render a response.

The popup has to be closed in the client.
 
leonardo ginting
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks tim for your response,
are you sure tim i cant do that?
i have another idea how to make it but i would like to asking about how could put if statement on a4j:commandlink
because the idea is when the data is updated rich:popup close automatically,,

thanks
 
Tim Holloway
Saloon Keeper
Posts: 28069
198
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
Yes I'm sure you can't do that. Webapps don't run as continuous processes, so there'd be nothing running that could push out the close command even if if was legal to send a command out without receiving a request first. Which it isn't, even in non-Java webapps.

You can put a close() command on the popup's "Submit" button, though, and I do that all the time. It's not run from the managed bean - it runs on the client.

If you want the dialog to conditionally close - for example, if the submit fails, display a message on the dialog and keep it open - that's a stickier problem. I have a solution, but it's specific to RichFaces V3 and involves the ability of the a4j:commandButton/commandLink controls to return a JSON datastream that contains a go/no-go value and an error message.
 
You've gotta fight it! Don't give in! Read this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic