Layouting and a4j:regions? (Newbie question?)
antontrapp Jul 24, 2009 4:32 AMHello RichFaces community!
I just started with RichFaces some days ago (was the winner of my JavaScript Ajax frameworks for Java), so maybe I got something totally wrong from the books, tutorials and googled pages I allready read...
I have a panelGrid (for the layouting of labels and input elements) and two selections (regions depending on nations). The code is pretty simple and looks like this:
<h:panelGrid columns="2"> ... <h:outputText value="#{mls.country}"/> <a4j:region renderRegionOnly="true"> <h:selectOneMenu id="nation" value="#{nation}"> <f:selectItems value="#{companyAddressBean.nations}"/> <a4j:support event="onblur" actionListener="#{companyAddressBean.changeCountry}" process="region_area"/> </h:selectOneMenu> </a4j:region> <h:outputText value="#{mls.region}"/> <a4j:region renderRegionOnly="true" id="region_area"> <h:selectOneMenu id="region" value="#{companyAddressBean.company.address.region}"> <f:selectItems value="#{companyAddressBean.regions}"/> </h:selectOneMenu> </a4j:region>
Now I have some questions that I can't answer from the books and manuals:
1) The a4j:region should imho be a logical group, but it does group all elements in the output and renders them as one. So I can not create a4j:regions over multiple lines, right? (maybe someone can tell me why the region is a layout and a logical grouping element or what element for the grouping only I missed).
2) When I change the region (a4j:support) the call goes to the backend and works as expected, but the process statement does not trigger a reRender (the reRender does not work in this case because of the seperate regions). The region - selectOneMenu is only populated at page requests. How can I rerender this area when something in the first changes (as I think there is no solution for a region over multiple lines)?
3) Is the panel/region the best layout for classic HTML pages with label/field and Ajax validation)? This is used in all the tutorials I read...
Thank you very much in advance!
Greetings,
Anton