0

problem with Chosenbox on window with attribute onOK

asked 2019-11-11 19:50:51 +0800

gvguad gravatar image gvguad
3 1

Hi everybody. I have problem when I try to select an item in chosebox which is located in window container with attribute onOK by pressing enter. It invokes function which specified in onOK not in onSelect from chosenBox. So schosenbox left empty because this windows closes in onOk function. Is there a way to fire chosenBox functios bfore window onOK?

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-11-12 15:21:53 +0800

cor3000 gravatar image cor3000
4952 2 7
ZK Team

updated 2019-11-12 15:23:58 +0800

I did this by listening to w:onOK at client side, and call the internal function _doEnterPressed to trigger the update before losing focus. Then forward the server side onOK-event back to the outer dialog so it can be detached.

  <window id="dialog" title="select and ENTER" 
          border="normal" mode="modal" 
          onOK="self.detach();">
    <chosenbox model="${choices}" 
               onSelect="Clients.log(choices.getSelection().toString())" 
               w:onOK="this._doEnterPressed()" forward="onOK=dialog.onOK"/>
  </window>

Here a runnable zkfiddle. Maybe that's what you need, if not feel free to adjust the zkfiddle with additional information and post the updated link here.

link publish delete flag offensive edit
Your answer
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
2 followers

RSS

Stats

Asked: 2019-11-11 19:50:51 +0800

Seen: 11 times

Last updated: Nov 12

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