繁体   English   中英

无法从DojoFaces按钮组件调用托管bean动作方法

[英]Can not invoke managed bean Action method from DojoFaces button component

我试图在下一个基于JSF的portlet中使用DojoFaces。 我正在将JSF 1.1与JSR 286 portlet一起使用,以部署在WPS 6.1上。

问题是,我正在使用带动作属性,该属性应调用JSF托管bean动作方法。 但是,事实并非如此。

<dojo:button id="myBtn" label="DOJOSubmit" attr="type: 'submit'" rendered="true"      
action="\#{myBean.myAction}">    </dojo:button>

有趣的是,我创建了一个phaseListener,只是为了检查单击按钮时会发生什么。 我注意到,它经历了除“调用应用程序”之外的所有阶段。 如下,

[20/09/11 17:29:13:355 BST] 0000013a SystemOut     O Before:RESTORE_VIEW 1
[20/09/11 17:29:13:355 BST] 0000013a SystemOut     O Before:RESTORE_VIEW 1
[20/09/11 17:29:13:355 BST] 0000013a SystemOut     O AFTER:RESTORE_VIEW 1
[20/09/11 17:29:13:355 BST] 0000013a SystemOut     O AFTER:RESTORE_VIEW 1
[20/09/11 17:29:13:355 BST] 0000013a SystemOut     O Before:APPLY_REQUEST_VALUES 2
[20/09/11 17:29:13:355 BST] 0000013a SystemOut     O Before:APPLY_REQUEST_VALUES 2
[20/09/11 17:29:13:355 BST] 0000013a SystemOut     O AFTER:APPLY_REQUEST_VALUES 2
[20/09/11 17:29:13:355 BST] 0000013a SystemOut     O AFTER:APPLY_REQUEST_VALUES 2
[20/09/11 17:29:13:355 BST] 0000013a SystemOut     O Before:PROCESS_VALIDATIONS 3
[20/09/11 17:29:13:355 BST] 0000013a SystemOut     O Before:PROCESS_VALIDATIONS 3
[20/09/11 17:29:13:355 BST] 0000013a SystemOut     O AFTER:PROCESS_VALIDATIONS 3
[20/09/11 17:29:13:355 BST] 0000013a SystemOut     O AFTER:PROCESS_VALIDATIONS 3
[20/09/11 17:29:13:355 BST] 0000013a SystemOut     O Before:UPDATE_MODEL_VALUES 4
[20/09/11 17:29:13:355 BST] 0000013a SystemOut     O Before:UPDATE_MODEL_VALUES 4
[20/09/11 17:29:13:355 BST] 0000013a SystemOut     O AFTER:UPDATE_MODEL_VALUES 4
[20/09/11 17:29:13:355 BST] 0000013a SystemOut     O AFTER:UPDATE_MODEL_VALUES 4
[20/09/11 17:29:13:386 BST] 0000013a SystemOut     O Before:RESTORE_VIEW 1
[20/09/11 17:29:13:386 BST] 0000013a SystemOut     O Before:RESTORE_VIEW 1
[20/09/11 17:29:13:402 BST] 0000013a SystemOut     O AFTER:RESTORE_VIEW 1
[20/09/11 17:29:13:402 BST] 0000013a SystemOut     O AFTER:RESTORE_VIEW 1
[20/09/11 17:29:13:402 BST] 0000013a SystemOut     O Before:RENDER_RESPONSE 6
[20/09/11 17:29:13:402 BST] 0000013a SystemOut     O Before:RENDER_RESPONSE 6
[20/09/11 17:29:13:402 BST] 0000013a SystemOut     O AFTER:RENDER_RESPONSE 6
[20/09/11 17:29:13:402 BST] 0000013a SystemOut     O AFTER:RENDER_RESPONSE 6

有人可以解释一下为什么会这样吗?

关于惠普

感谢Dojofaces的Ganesh,我的理解是正确的。

问题是我离开了输入组件,但没有将其与托管bean绑定值,如下所示,应避免这种情况。

<dojo:form id="dojoForm">
<dojo:textBox id="dftextbox" attr="" value="" />

<dojo:button id="tundraButton" label="DOJOSubmit" attr="type: 'submit'" rendered="true" action="\#{myBean.myAction}">         
</dojo:button>    

</dojo:form>

因此,如建议的那样,我在textBox上附加了一个托管bean的值,如下所示:

<dojo:textBox id="dftextbox" attr="" value="#{myBean.myText}" />

就是这样。 它为我工作。

希望这对某人有帮助!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM