• Post Reply Bookmark Topic Watch Topic
  • New Topic

Form hiding mystery - sometimes hides, the other times doesn't

 
YinLi Tao
Greenhorn
Posts: 7
Debian Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,


What I'm trying to achieve in the code below is to show/hide a form once the button is clicked. It works, kind of... There are times the form will not hide for a few clicks and there are times the form will not appear for a few clicks even though the visibility field in the bean gets set every time. What is the problem?

Also, a bonus mystery. In the xhtml file below I have a kind of useless <h:form id="randomform"></h:form> entry. I say useless because I don't need it but without it clicking on the button has no effect whatsoever. Why?


 
YinLi Tao
Greenhorn
Posts: 7
Debian Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looks like the problem is caused by the PrimeFaces button:



Changing to



makes everything works just fine.

As for the bonus the button should itself have been wrapped in a form.
 
YinLi Tao
Greenhorn
Posts: 7
Debian Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It appears that PrimeFaces button doesn't like the <f:ajax> component.

Changing from:



to:



solves the problem.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!