0

Bug setWidgetOverride with onOK event in bandbox

asked 2017-06-14 14:56:32 +0800

LuigiFabbri gravatar image LuigiFabbri
46 5

updated 2017-06-15 09:01:39 +0800

hello,

If I insert onOK event on zul and apply numeric mask to text1 field with setWidgetOverride, this is also incorrectly applied to text2 field, if I don't insert onOK event on zul, text2 works correctly.

This is my example zul:

<window title="new page title" border="normal">

<bandbox id="text1" onok="">

<attribute name="onCreate">
<![CDATA[
    self.setWidgetOverride("afterKeyDown_","function (evt,simulated) {" +
            "var KeyCode = evt.keyCode;" +
            "var CtrlKey=false;if ( evt.ctrlKey!=null && evt.ctrlKey==true ) CtrlKey=true;" +
            "if ( CtrlKey || (KeyCode>=48 && KeyCode<=57) || (KeyCode>=96 && KeyCode<=105) ||  KeyCode==46 || KeyCode==44 || KeyCode==8 || KeyCode==9 || KeyCode==13 || " +
                 "KeyCode==39 || KeyCode==37 || KeyCode==45 || KeyCode==188)" +
               "return this.$afterKeyDown_(evt,simulated);" +
            "else " +
               "evt.stop();" +
   "}");      
]]>
</attribute>

<bandpopup><textbox id="text2"></textbox></bandpopup>

</bandbox>

</window>

delete flag offensive retag edit
Be the first one to answer this question!
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2017-06-14 14:56:32 +0800

Seen: 10 times

Last updated: Jun 15 '17

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More