0

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?

4

2 回答 2

0

尝试ajaxsingle="true"在您的a4j:support标签上使用。由于您h:form在 onrowclick 触发请求时使用,因此 h:form 中的所有组件都将在更新模型阶段在服务器上进行处理。

希望这可以帮助。

于 2012-07-12T00:18:05.020 回答
0

嵌套 s 是不可取的,<h:form>但我们可以有多个<h:form>s,尝试修改您的代码,使<h:commandButton>are 在一个形式中h:form,而<h:modalPanel>is 在另一种形式中

希望这可以帮助。你也可以试试<a4j:form>formodalPanel

于 2012-07-12T09:28:26.753 回答