a4j:region implementation proposal in 4.x
ilya_shaikovsky Nov 10, 2009 8:15 AMMy first proposal from wiki was:
1) Region The developer should have a possibility to define zones to be processed at server side without using execute definitions to be defined at every component.Proposed to leave our current mechanism as default opposite to JSF 2 which has execute and render defined as @this if not redefined.
Currently this functionlity not implemented and execute should be used instead.
For this we could
1. add new @region keywords available for RichFaces core Ajax components and define it as default.
1. This will be available only for RF ajax components. Probably we should fill proposal to Mojara in order not to rewrite their mechanism to provide support of regions in f:ajax.
2. consider viewRoot as root region as it was done before.
There was reasonable comment from Jay
# Not sure about overriding JSF default behavior for the regions. I like the comment regarding discussing this with mojarra instead of overwriting their default.
So currently let's revise slightly changed proposal:
Regions should has the same processing limitation functionality as for 3.3.x except one point - the component should be defined with execute="@region" to use them.
It's eliminates cool feature of 3.3.x that users didn't carried about additional attribute definition and regions just worked for them.
BUT if we will take into consideration real applications with deep template's level - the developer will still gain benefits from not carrying about name of the region (of the wrapper component to be processed) but just using this shortcut. Example:
<a4j:region>
<h:inputText value="#{userBean.name}">
<a4j:ajax event="onkeyup" render="outname" execute="@region"/>
</h:inputText>
</a4j:region>
and
<h:panelGrid id="grid">
<h:inputText value="#{userBean.name}">
<a4j:ajax event="onkeyup" render="outname" execute="grid"/>
</h:inputText>
</h:panelGrid>The snippets looks very similar. But the first one looks much more easier to maintain if the region component and the Ajax components placed in different templates levels.