I work on a JSF 1.2 application with Richfaces 3.3. I have a popup which contains a rich:extendedDataTable. When I click a row in a table I want to enable or disable a button, and I use a4j:support event="onRowClick".
Here is some code:
<h:form>
<rich:panel id="main">
<a4j:commandButton id="completed" value="Completed"
rendered="#{bean.completedCase}" />
<a4j:commandButton value="Open"
oncomplete="#{rich:component('popupId')}.show(...)">
</a4j:commandButton>
<rich:modalPanel id="popupId">
<a4j:region>
<rich:extendedDataTable id="source" value="#{bean.sourceItems}"
var="sourceItem" selectionMode="single" >
<a4j:support event="onRowClick" eventsQueue="pickQueue" reRender="copy" >
<f:setPropertyActionListener value="#{sourceItem}"
target="#{bean.sourceSelection}" />
</a4j:support>
....
</rich:extendedDataTable>
<a4j:commandButton id="copy" value="Copy" />
</a4j:region>
<a4j:commandButton value="Ok" reRender="completed"
oncomplete="#{rich:component('popupId')}.hide();return false;">
</a4j:commandButton>
</rich:modalPanel>
</rich:panel>
</h:form>
The problem is that when I click a row, then in the backend are called some methods that are use to render a button: rendered="#{bean.completedCase}", but the button is not on the popup, but on the page beyond the popup. Any idea why there are called other methods than the ones used for the table?
Try using
ajaxsingle="true"on youra4j:supporttag. Since your are usingh:formwhen the onrowclick fire a request ,all of the components inside the h:form will be processed on the server during update model phase.Hope this helps.