I've used <rich:modalPanel> inside a dataTable successfully in the past. I did it in two ways. For simple <rich:modalPanel> i.e a modal panel that requires no actions except for just displaying information, I just put <rich:modalpanel> inside the dataTable. This is not really a good solution since, one modal panel is associated to multiple instances of object. And I have conversation time out experience when I tried to open up the modal panel and close it multiple times quickly.
The other way to use modal panel is to send parameters to the modal panel. This is useful especially if you have a form inside a modal panel which you want to do processing. In this scenario, modal panel is declared outside the data table. Every time, the panel is open, an object reference can be passed to a variable in the backing bean so that we know which object we want to associate the currently active panel with. Obviously, this requires more steps on the programmer side.
Honestly, I do not have a good experience working with modal panel. In theory, modal panel sounds a good solution for many user interfaces, but I still find that <rich:modalPanel> to be lacking in some features that I would want. Also, it doesn't allow nested forms inside the panel.
So, my last annoying experience with <rich:modalPanel> is when I want to include a page inside a modal panel. And the page is dyanmic, i.e, given the object information, I would like to include a certain page. So, I have <a4j:include sr="#{object1.name}.xhtml" inside the modal panel. It turns out that I cannot do that and every time I tried to access the page, object1.name returns an emtpy string. I think what is happening is that <rich:modalPanel> is being rendered on the page load. It's not dynamic rendering. Therefore, the object value is not there and it's not returning the appropriate page. I need to do a little bit more debugging regarding my assumptions. But when I can add a static page to be included in the modal panel, it worked just fine..
No comments:
Post a Comment