Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Trouble with ContextMenu and ModalPanel of RichFaces

 
Wei Geng
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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>
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic