具有 this.action 的 XPages EventHandler actionListener - actionListener 不触发
XPages EventHandler actionListener with this.action - actionListener does not fire
我正在开发 XPage。
我有一个 ContractsBean 的 managedBean。在 ContractsBean 中,我有一个方法 saveContract()。
在 XPage 上,我还有一个数据源绑定到另一个 NSF 中的文档,它的变量是标准的#{document1}。
部分页面数据来自 NSF 文件,页面的其他部分来自 DB2。
我正在使用 保存页面,一些数据进入 NSF,其他数据进入 DB2。我首先与 NSF 合作,并使用 document1 成功保存了数据。
然后我添加了一个 ActionListener 来调用事件监听器,但事件监听器没有触发。我删除了 save document1 并且 ActionListener 正常触发。
难道我不能在同一个事件处理程序中同时拥有 xp:this.action 和 actionListeners 吗?
任何 JSF 大师,这可能看起来很熟悉......
<xp:button value="Submit" id="btnSubmit"
styleClass="btn green pull-left">
<xp:eventHandler event="onclick" submit="true"
refreshMode="norefresh" immediate="true">
<xp:this.action>
<xp:saveDocument var="document1"></xp:saveDocument>
</xp:this.action>
<xp:this.actionListeners>
<xp:actionListener
type="com.page.listeners.SaveContractListener">
</xp:actionListener>
</xp:this.actionListeners>
</xp:eventHandler>
</xp:button>
现在,如果我这样做,删除它起作用的 xp.this.action,动作侦听器会触发。
<xp:button value="Submit" id="btnSubmit"
styleClass="btn green pull-left">
<xp:eventHandler event="onclick" submit="true"
refreshMode="norefresh" immediate="true">
<xp:this.actionListeners>
<xp:actionListener
type="com.page.listeners.SaveContractListener">
</xp:actionListener>
</xp:this.actionListeners>
</xp:eventHandler>
</xp:button>
如果我不能在 EventHandler 中同时拥有两者,有什么替代方法可以使用 ActionListener 获取 document1 的句柄(如何?)并将其保存在我的 actionListener 中?
我使用这个标记让它工作
<xp:button value="Submit" id="btnSubmit"
styleClass="btn green pull-left">
<xp:eventHandler event="onclick" submit="true"
refreshMode="complete" disableValidators="true" immediate="true">
<xp:this.action>
<xp:actionGroup>
<xp:saveDocument var="document1"></xp:saveDocument>
</xp:actionGroup>
</xp:this.action>
<xp:this.actionListeners>
<xp:actionListener
type="com.page.SaveContractListener">
</xp:actionListener>
</xp:this.actionListeners></xp:eventHandler>
</xp:button>
我正在开发 XPage。
我有一个 ContractsBean 的 managedBean。在 ContractsBean 中,我有一个方法 saveContract()。
在 XPage 上,我还有一个数据源绑定到另一个 NSF 中的文档,它的变量是标准的#{document1}。
部分页面数据来自 NSF 文件,页面的其他部分来自 DB2。
我正在使用 保存页面,一些数据进入 NSF,其他数据进入 DB2。我首先与 NSF 合作,并使用 document1 成功保存了数据。
然后我添加了一个 ActionListener 来调用事件监听器,但事件监听器没有触发。我删除了 save document1 并且 ActionListener 正常触发。
难道我不能在同一个事件处理程序中同时拥有 xp:this.action 和 actionListeners 吗?
任何 JSF 大师,这可能看起来很熟悉......
<xp:button value="Submit" id="btnSubmit"
styleClass="btn green pull-left">
<xp:eventHandler event="onclick" submit="true"
refreshMode="norefresh" immediate="true">
<xp:this.action>
<xp:saveDocument var="document1"></xp:saveDocument>
</xp:this.action>
<xp:this.actionListeners>
<xp:actionListener
type="com.page.listeners.SaveContractListener">
</xp:actionListener>
</xp:this.actionListeners>
</xp:eventHandler>
</xp:button>
现在,如果我这样做,删除它起作用的 xp.this.action,动作侦听器会触发。
<xp:button value="Submit" id="btnSubmit"
styleClass="btn green pull-left">
<xp:eventHandler event="onclick" submit="true"
refreshMode="norefresh" immediate="true">
<xp:this.actionListeners>
<xp:actionListener
type="com.page.listeners.SaveContractListener">
</xp:actionListener>
</xp:this.actionListeners>
</xp:eventHandler>
</xp:button>
如果我不能在 EventHandler 中同时拥有两者,有什么替代方法可以使用 ActionListener 获取 document1 的句柄(如何?)并将其保存在我的 actionListener 中?
我使用这个标记让它工作
<xp:button value="Submit" id="btnSubmit"
styleClass="btn green pull-left">
<xp:eventHandler event="onclick" submit="true"
refreshMode="complete" disableValidators="true" immediate="true">
<xp:this.action>
<xp:actionGroup>
<xp:saveDocument var="document1"></xp:saveDocument>
</xp:actionGroup>
</xp:this.action>
<xp:this.actionListeners>
<xp:actionListener
type="com.page.SaveContractListener">
</xp:actionListener>
</xp:this.actionListeners></xp:eventHandler>
</xp:button>