【问题标题】:f:setPropertyActionListener not workingf:setPropertyActionListener 不工作
【发布时间】:2011-09-24 03:32:09
【问题描述】:

我正在使用 Richfaces 数据表。

要编辑 rich:datatable ,我使用了以下几行

<a4j:commandLink 
    styleClass="no-decor" 
    reRender="machineDisplayTable"
    value="edit"
    oncomplete="#{rich:component('editMyMachinePanel')}.show()">
    <f:setPropertyActionListener
        target="#{machineTable.myMachineToEdit}"
        value="#{Machine}"/>
</a4j:commandLink>

其中“machineDisplayTable”是数据表的 id,“editMyMachinePanel”是丰富的:modalpanel,“machineTable”是 bean 类,“myMachineToEdit”是机器类型的类。

现在,在我打印“machineTable.myMachineToEdit.hostname”的 rich:modelpanel 中,我什么也没得到。模型面板的代码为:

<rich:modalPanel id="editMyMachinePanel" autosized="true">
    <f:facet name="header">
        <h:outputText value="#{machineTable.myMachineToEdit.hostname}" />
    </f:facet>
    <a4j:commandButton value="Cancel" onclick="#{rich:component('editMyMachinePanel')}.hide(); return false;" />
</rich:modalPanel>

似乎第一个面板正在渲染,然后 f:setPropertyActionListener 将值分配给 machineTable.myMachineToEdit。

无论如何我可以先分配 machineTable.myMachineToEdit 然后渲染 modalpanel。

两个imp站点,相同的是:

http://richfaces-showcase.appspot.com/richfaces/component-sample.jsf?demo=dataTable&sample=dataTableEdit&skin=blueSky

http://binamebou.be/phoenix-framework/wiki/index.php5?title=Richfaces_FAQ

在第二个链接(设置操作)中提供了一个解决方案,但在我的情况下也不起作用。

【问题讨论】:

    标签: jsf jakarta-ee richfaces


    【解决方案1】:

    在您的情况下,您应该在按下 a4j:commandLink 时重新渲染面板。不是桌子。

    reRender="editMyMachinePanel"

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-03-30
      • 1970-01-01
      • 2013-03-14
      • 1970-01-01
      相关资源
      最近更新 更多