File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes Trouble with ContextMenu and ModalPanel of RichFaces Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Trouble with ContextMenu and ModalPanel of RichFaces" Watch "Trouble with ContextMenu and ModalPanel of RichFaces" New topic
Author

Trouble with ContextMenu and ModalPanel of RichFaces

Wei Geng
Greenhorn

Joined: Dec 10, 2004
Posts: 28
Hi all,

I met some trouble when I used the RichFaces contextMenu and modalPanel together.

I hope to show the modalPanel by clicking the context menu item.

For the first time I clicked the menu item, the modal was showed. However, the second time, the menu item even didn't execute. Then the third time, everything went well again. And then 4th time failed, 5th time succeeded, 6th time failed..., alternately.

Thus, 50% succeeded and 50% failed. It's too weird.




When I remove the code on line 10.


The actionListener of menuItem can be executed successfully every time.

Can anybody help to advise the reason?

Thanks in advance!



Fan He
Greenhorn

Joined: Jun 15, 2009
Posts: 1
I've met the similar problem that only the first time the panel can be displayed. From the second time (after the panel was hide for once) you will never see the panel.

The following alternative method may help:

Wei Geng
Greenhorn

Joined: Dec 10, 2004
Posts: 28
Fan He wrote:I've met the similar problem that only the first time the panel can be displayed. From the second time (after the panel was hide for once) you will never see the panel.

The following alternative method may help:



Thanks for your reply and your alternative method.

However, I really want to know the root cause of that issue.

Did us make anything wrong with the code or is it actually a bug of RichFaces?

Will Barquero
Greenhorn

Joined: Nov 13, 2009
Posts: 1
Try changing your <rich:menuItem> tag to this:

<rich:menuItem value="try"
oncomplete=""Richfaces.showModalPanel('modalPanel',{width:200})"
actionListener="#{contextMenuTestBean.menuClicked}"
reRender="modalPanel" >
</rich:menuItem>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Trouble with ContextMenu and ModalPanel of RichFaces