[jboss-user] [JBoss Seam] - Re: AJAX4JSF: Problems with validation.

bfo81 do-not-reply at jboss.com
Mon Sep 18 05:19:31 EDT 2006


I finally found the solution (or let's say wcasatti from Exadel forum told me how to do it right):

With the a4j:region tag you can define which components shall be decoded during the JSF lifecycle. This is where the language barrier was a problem for me since didn't understand that "decode" meant "process" (but I think some native speakers didn't catch that either *g*).

So if define a a4j:region around the select menu 1 then only this single component is validated. That's what I wanted. But in order to create the output for the new menu 2 I need to set the attribute renderRegionOnly to "false", so that the other components are included in the AJAX response, too.

Well, here's the code:

  | <a4j:region renderRegionOnly="false">
  |     <h:selectOneMenu id="menu1" value="..." required="true">
  |         <f:selectItems ... />
  |         <a4j:support event="onchange" reRender="menu2" />
  |     </h:selectOneMenu>
  | </a4j:region>
  | 
  | <h:selectOneMenu id="menu2" ....
  | ....

PS: I think that the attribute ajaxSingle should be deprecated. It might leads to problems and a4j:region does it much better :).

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3972227#3972227

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3972227



More information about the jboss-user mailing list