开发者

f:setPropertyActionListener not working

I am using richfaces datatable.

To edit the rich:datatable , i used following lines

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

where "machineDisplayTable" is id for datatable, "editMyMachinePanel" is rich:modalpanel, "machineTable" is bean class and "myMachineToEdit" is class of type machine.

Now, in rich:modelpanel , where i am printing "machineTable.myMachineToEdit.hostname", i am getting nothing. The code for modelpanel as:

<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('editMyMac开发者_如何转开发hinePanel')}.hide(); return false;" />
</rich:modalPanel>

It seems that first panel is getting rendered and then value is assigned to machineTable.myMachineToEdit by f:setPropertyActionListener.

Is there anyway i can assign machineTable.myMachineToEdit first and then render modalpanel.

Two imp site, regarding same is :

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

and

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

One solution is provided in second link (setting action), but is is also not working in my case.


In your case, you should reRender the panel when pressing the a4j:commandLink. Not the table.

reRender="editMyMachinePanel"

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜