So, I have been complaining about RichFaces AJAX a lot. The more I get to use most of its features, the more I find that AJAX is not as "agile" as we think. There is one components of AJAX that I really dislike of. It's
.
is good if you have something like a warning to display. But if you want to do more such as adding a form onto the , it can give you a hard time. I am not going into length about how it caused me troubles. I'm going to talk in this post about how I called a modal panel inside another modal panel.
So, I have this first modal panel (let's call it panelA) which contains a select one radiobox and a commandButton. So, it's a very basic form where users can make a choice and click the commandButton and in the background, all the events are happening. After the method is called, the page is refreshed with new information. So, the method() in my commandButton is not a very lengthy one. But, depending on the connection, it can take slow and often cause timeout to the users. So, I want to add an indicator that shows that there's something processing in the background and during the processing period, I don't want to let users do any type of additional processing.
Since calling modal panel is mainly done by using javascripts, I tried using onclick and oncomplete attributes of the commandButton. But for some reasons, it didn't work. So, here's what I did in the end :
So, with the help of and , I managed to call another modal panel from inside a modal panel.
If you have a page with multiple method calls which can take long time, I would suggest you to follow the techniques mentioned in here.
http://community.jboss.org/wiki/RichFacesPleaseWaitBox
No comments:
Post a Comment