Revision history [back]

click to hide/show revision 1
initial version

asked 2021-03-31 18:41:36 +0800

ziobleed gravatar image ziobleed

onSearchEvent not fired on chosenBox when hitting ENTER

hi i implemented a chosenbox in zk 6.x

i intercept the event onSearch

like:

chosenbox.addEventListener("onSearch", new EventListener<InputEvent>() {
            @Override
            public void onEvent(InputEvent event) throws Exception {
                       ... add to model
                       ... add to selected items

It works when user click on the "plus" sign showed when the user inputs a new element in the chosen box. BUT it is not called when user click on key "ENTER" or write (ie) ";" (yes, i tried also to specify the separator=";" attribute in <chosenbox>

in zul the chosenbox is as:

<chosenbox id="chosenboxA" creatable="true" createMessage="{0}" emptyMessage="Specify a value" hflex = "1" />

best regards

ZB

onSearchEvent not fired on chosenBox when hitting ENTER

hi i implemented a chosenbox in zk 6.x

i intercept the event onSearch

like:

chosenbox.addEventListener("onSearch", new EventListener<InputEvent>() {
            @Override
            public void onEvent(InputEvent event) throws Exception {
                       ... add to model
                       ... add to selected items

It works when user click on the "plus" sign showed when the user inputs a new element in the chosen box. BUT it is not called when user click on key "ENTER" or write (ie) ";" (yes, i tried also to specify the separator=";" attribute in <chosenbox>

in zul the chosenbox is as:

<chosenbox id="chosenboxA" creatable="true" createMessage="{0}" emptyMessage="Specify a value" hflex = "1" />

best regards

UPDATE: discovered that the problem is related to the fact that i use a ListSubModel as model of the chosen box. I need the sub model to implement a search by "contains" and not "starts with" as explained here: forum.zkoss.org/question/100468/override-onsearching-in-chosenbox/

so i can't have the "contains" search and the ENTER key functionality at the same time.

I also tried to use 6.5.5 version of zk without success (problem persist)

ZB

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