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?
Its not advisable to have nested
<h:form>
s but we can have multiple<h:form>
s ,try modifying your code in such a way that the<h:commandButton>
are in oneh:form
and the<h:modalPanel>
is in another formHope this helps. u can also give a try with
<a4j:form>
formodalPanel