-
FEATURED COMPONENTS
First time here? Check out the FAQ!
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
I can reproduce what you mentioned partially.
onSearch
The semicolon doesn't work which is a bug(https://tracker.zkoss.org/browse/ZK-4849) and it's fixed in the later version. Please use another character like ,
onSearch
I can't reproduce this with 6.5.8.1
, please try https://zkfiddle.org/sample/2li6mct/1-chosenbox-separator-semicolon
aaa
show a dialog with onSearch event string
Could you try the zkfiddle and give us feedback or modify it to reproduce your issue?
I found it's a known bug: https://tracker.zkoss.org/browse/ZK-3010 which is fixed at 8.0.1
I think the workaround is using ListModel
.
Asked: 2021-03-31 18:41:36 +0800
Seen: 11 times
Last updated: Apr 19 '21
wrong valueException come in front of modal popup [closed]
Use parameters in a conditional @command
Problems with multiple press and onCtrlKey
MVVM @save on the fly [closed]
Unable to activate destroyed desktop
org.zkoss.zk.ui.UiException: java.lang.ClassNotFoundException
How to put a image or Letter over image on a specific XY Coordinate
( i cant answer, the zk foums says "answer must be > 10 chars", i'm using firefox) . t try to paste my answer here: ======== thanks for your ansewer
the problem seems related to the use of the ListSubModel in my project indeed i use ListSubModel.
Using ListSubModel the ENTER key doesnt work.
ziobleed ( 2021-04-01 17:36:44 +0800 )edit.... i updated the fiddle. With my update the ENTER key doesn't work
ziobleed ( 2021-04-01 17:37:50 +0800 )editalso i cant: upvote or post link
ziobleed ( 2021-04-01 17:38:56 +0800 )editto see my fiddle the link is https://zkfiddle.org/sample/2li6mct/2-chosenbox-separator-semicolon
ziobleed ( 2021-04-01 17:41:43 +0800 )edit