This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
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

Input validation is not happening with ajaxify command button

 
prasad kakani
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi All,

I tried alot to validate the input fields with ajax call of command button. Its not working at all.. But if we just use command action then validation is happening. Dont know what is happening inside the code..Can you please help me out??


This is my code.






if <f:ajax execute="@this" render="@form"/> is removed then validation is happeing.but this code is placed then validation is not happening. Dont know exactly what is happening here..


 
Tim Holloway
Saloon Keeper
Pie
Posts: 18277
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can venture a suggestion. It's the best I can do until I can spare the time to actually learn how the JSF2 ajax tag works (I'm still working with RichFaces3).

In RichFaces, at least, there's the ability to limit the data being transmitted when a submit is done. "immediate="true"" would submit no data at all (basic JSF), "ajaxSingle="true"" would submit only the value of the control that contained the ajax submit (RichFaces a4j:support tag), and no qualification would submit the entire form.

So what I suspect is that your f:ajax tag is doing is the equivalent of the RichFaces "ajaxSingle" submit and you need to modify it to widen the data set being submitted.
 
prasad kakani
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah you are correct Tim,

if i use <f:ajax execute="@all" render="@form"/> instead of <f:ajax execute="@this" render="@form"/>

Then it is working fine..

Thanks Alot Tim.



 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic