XPages disable eventHandler

南笙酒味 提交于 2019-12-13 07:47:25

问题


I have a span tag with an onCLick event handler. I would like to disable the event handler based on the value of a scope variable. The scope variable is being set when I click a checkbox.

How can I do this?

Thanks for your input!

Dan


回答1:


In client side part of the event use this code.

return !#{sessionScope.disableEvent};

That should render as

return !false; // continues to SSJS

or

return !true; // no SSJS



回答2:


Event handlers have a rendered-attribute that you can calculate. If the span in question is in the area that's being refreshed, you can use this attribute to control if the event handler is active or not.

E.g.

<xp:eventHandler event="onclick" rendered="#{viewScope.someVariable == 'someValue'}" ... />


来源:https://stackoverflow.com/questions/43524155/xpages-disable-eventhandler

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!