Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

a4j:support and javascript validation problem  RSS feed

 
Janardan Kelkar
Ranch Hand
Posts: 72
Eclipse IDE Firefox Browser Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,



This does not work, i either have to remove the onclick attribute from h:commandLink , to get the a4j:support working, OR i have to remove the a4j:support tag to get the javascript validation running. If i keep both, nothing works..

Please help, Thanks.
 
Brajendra Mathema
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi janardan

you can place your javascript validation part in a4j:support tag under onsubmit attribute


<h:commandLink action="#{myBean.myMethod}" styleClass="btn">
<f:verbatim><span></span>My Button</f:verbatim>
<a4j:support event="onclick" onsubmit="return validateGenerateCriteria('myElementId);"/>
</h:commandLink>

and use form name while accessing the form elements i.e. form:myElementId

thankyou
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!