【问题标题】:Seam pages action is called before the h:commandButton action [duplicate]在 h:commandButton 操作之前调用 Seam pages 操作 [重复]
【发布时间】:2016-03-08 15:07:37
【问题描述】:

我在 updatePerson.xhtml 中有这个 h:commandButton 来更新人员信息,但是当我单击它时,将调用页面操作方法 (controller.preUpdatePerson),就好像我再次进入此页面一样。我对页面操作的调用更加迷失了,因为此时 controller.preUpdatePerson 中的对象为空,然后它就停在这里了。

controller.update 永远不会被调用。 我不知道为什么会这样。所有实体和控制器都在对话范围内。我尝试了很多组合,这似乎不是交易问题。那么这里发生了什么?

系统规格:Seam 2.2.2 JSF 1.2

pages.xml:

    <page view-id="/updatePerson.xhtml">
        <action execute="#{controller.preUpdatePerson}" on-postback="false" />
        <begin-conversation join="true" flush-mode="manual"/>

updatePerson.xhtml:

<a4j:form id="editPerson" styleClass="inline" enctype="multipart/form-data">
<h:commandButton id="editPerson" value="#{messages['button.save']}" 
                    action="#{controller.update}"/>
...

【问题讨论】:

    标签: jsf seam jsf-1.2 ajax4jsf seam2


    【解决方案1】:

    基于这个答案commandButton/commandLink/ajax action/listener method not invoked or input value not updated 我的问题与 enctype="multipart/form-data" 作为页面提交文件上传有关。 我必须在 web.xml 中正确配置过滤器。

    【讨论】:

    猜你喜欢
    • 2012-07-06
    • 2013-06-26
    • 2013-06-08
    • 1970-01-01
    • 1970-01-01
    • 2013-07-18
    • 1970-01-01
    • 2020-02-20
    • 1970-01-01
    相关资源
    最近更新 更多