Multiple <a4j:status> issue in Richfaces 4
kkn Jun 12, 2015 4:14 AMHi,
I have multiple regions on my xhtml page. Every region has one <a4j:status> tag.
With richfaces 3, the ids for different <a4j:status> tag were like below
accessForm:j_id191:status
accessForm:j_id243:status
accessForm:j_id289:status
After migrating to richfaces 4.5x, I am receiving a DuplicateIdException as the ids for all the <a4j:status> tags is accessForm:status.
I read the documentation and found that for id attribute in <a4j:status> tag - The component identifier for this component. This value must be unique within the closest parent component that is a naming container.
The code is as below
<h:form id="form">
<a4j:region>
<table>
<tr>
<td>
<a4j:region>
<a4j:outputPanel id="text">
<h:messages errorClass="msg" infoClass="green" layout="table" />
<h:inputTextarea
id="txt"
value="#{text}"/>
</a4j:outputPanel>
</a4j:region>
</td>
</tr>
<tr>
<td align="right" width="55%">
<a4j:commandButton
action="#{action}"
value="Save"
onclick="if (!validate()){return false;}isAjaxSubmission = true; "
render="text"
id="saveText"
title="Save"/>
  
</td>
<td width="45%" align="left">
<a4j:status id="status">
<f:facet name="start">
<h:graphicImage value="ajax_process.gif" />
</f:facet>
</a4j:status>
</td>
</tr>
</table>
</a4j:region>
<a4j:region renderRegionOnly="true">
<ui:define name="sectionContent">
<a4j:outputPanel id="tMsg">
<h:messages errorClass="msg" infoClass="green" layout="table" />
</a4j:outputPanel>
<a4j:outputPanel id="tCover" ajaxRendered="true">
<table width="100%">
<tr>
<td colspan="2">
SettleIt
</td>
<td>
<a4j:outputPanel ajaxRendered="true">
<h:panelGroup rendered="#{action}">
<h:selectOneMenu
id="dropdown"
value="#{value}">
<a4j:ajax
event="change"
render="sdropdown,rendercheck,rejectRendercheck,rejectStatusdropdown,tCover"
onsubmit="javascript: setShowAll();"/>
<f:selectItem itemValue=" " itemLabel="" />
<f:selectItems value="#{handlerBean.list}" />
</h:selectOneMenu>
<a4j:status id="status">
<f:facet name="start">
<h:graphicImage value="ajax_process.gif" />
</f:facet>
</a4j:status>
</h:panelGroup>
</a4j:outputPanel>
</td>
</tr>
<tr>
<td>
<a4j:outputPanel id="sdropdown" ajaxRendered="true">
<h:selectOneMenu
value="#{handlerBean.id}"
id="advanceId"
styleClass="smallfont">
<f:selectItems value="#{handlerBean.list}" />
</h:selectOneMenu>
</a4j:outputPanel>
<a4j:outputPanel id="rendercheck">
<h:selectBooleanCheckbox id="showall">
<a4j:ajax
event="onclick"
onsubmit="javascript: setShowAll();"
render="sdropdown"/>
<font class="headerfont">Show All</font>
</h:selectBooleanCheckbox>
</a4j:outputPanel>
</td>
</tr>
<tr>
<td>
<a4j:outputPanel id="rdropdown" ajaxRendered="true">
<h:selectOneMenu
value="#{handlerBean.id}"
id="rId">
<f:selectItems value="#{rList}" />
</h:selectOneMenu>
</a4j:outputPanel>
<a4j:outputPanel id="rOutput">
<h:selectBooleanCheckbox id="rShowall">
<a4j:ajax
event="click"
onsubmit="javascript: setShowAll();"
render="rdropdown"
/>
<font>Show All</font>
</h:selectBooleanCheckbox>
</a4j:outputPanel>
</td>
</tr>
</table>
</a4j:outputPanel>
</ui:define>
</a4j:region>
</h:form>
Can you please help in understanding how the implementation of <a4j:status> tag has been upgraded in 4.
Thank you!