0

Here's my .xhtml:

    <h:form id="form_edit"  prependId="false">
        <p:commandButton value="#{filt.add}"
                         ajax="true" 
                         icon="ui-icon-plus"
                         update=":messages :form_edit"
                         oncomplete="confDlg.show()"
                         action="#{agentsbean.clearSelectedAgent()}"/>
    </h:form>
    <p:dialog id="dialogId" widgetVar="confDlg" showEffect="fold" hideEffect="fade" 
              appendToBody="false">
        <h:form>
            <p:inputText value="#{agentsbean.selectedAgent.name==null?'null':agentsbean.selectedAgent.name}"/>
            <p:commandButton id="agConfirmSave" value="#{filt.save}" update=":messages @form"
                             actionListener="#{agentsbean.saveAgent}" oncomplete="confDlg.hide();"/>

        </h:form>
    </p:dialog>

actionListener saveAgent :

public void saveAgent(ActionEvent actionEvent) {
    System.out.println("SaveAgent");
}

When i click button (agConfirmSave) - dialog close, but action does not start!

  • primmefaces 3.5
  • Apache 7.0.35

UPD action work, if remove p:inputText or chang it by h:outputText!!! But i need input same text in dialog...

4

1 回答 1

2

这不是“setter”操作的有效值表达式。

<p:inputText value="#{agentsbean.selectedAgent.name==null?'null':agentsbean.selectedAgent.name}"/>

如果您作为一名真正的开发人员已经对服务器日志和 HTTP 流量监视器付出了更多的关注和喜爱,那么您应该已经注意到ELException/PropertyNotWritableException基本上已经是整个答案了。

至于如何解决它;整个表达本身实际上没有任何意义。EL 已经是空安全的。摆脱不必要的条件检查:

<p:inputText value="#{agentsbean.selectedAgent.name}"/>
于 2013-04-24T12:23:07.080 回答