0

Searching in Chosenbox

asked 2021-01-19 22:56:17 +0800

mmaxim gravatar image mmaxim
131

updated 2021-01-19 22:57:14 +0800

I need to make searching functionality of Chosenbox similar to Combobox when retrieving items from database. Unlike in Combobox when typing in Chosenbox it retrieves some itemes and throws away what was already entered. I would like to make it continuous.

delete flag offensive retag edit

4 Answers

Sort by ยป oldest newest most voted
0

answered 2021-01-20 12:40:51 +0800

hawk gravatar image hawk
2785 1 5
http://hawkphoenix.blogsp... ZK Team

I don't understand what you mean by "throw away". Could you give us an example or clear steps and describe what you see and what you expect?

For the current behavior:

(1) when you type a, it lists items starting with a in a popup

image description

(2) then type m, it lists items starting with am

image description

link publish delete flag offensive edit
0

answered 2021-01-20 16:32:19 +0800

mmaxim gravatar image mmaxim
131

It works just fine when i have a model for a chosenbox in place. But in my case the model has to be retrieved from datebase. When i type "a" it then goes to a database and retrieves model elements starting with "a", but it discards "a". The functionality i want to achive works in Combobox.

link publish delete flag offensive edit
0

answered 2021-01-20 18:44:20 +0800

hawk gravatar image hawk
2785 1 5
http://hawkphoenix.blogsp... ZK Team

updated 2021-01-21 09:16:10 +0800

jeanher gravatar image jeanher
1814 2 6
ZK Team

I think you might have replaced the ListModel object you set to Chosenbox when you load data from a database, this will cause a re-rendering and lose the user input.

You should keep using the same ListModel and call ListModelList.add() or ListModelList.addAll() to add items. Then it won't cause re-rendering.

link publish delete flag offensive edit
0

answered 2021-01-21 18:43:53 +0800

mmaxim gravatar image mmaxim
131

Unfortunalely it still doesn't work as expected.

link publish delete flag offensive edit

Comments

I just guess your usage according to your description. Could you provide related java code? or using http://zkfiddle.org/

hawk ( 2021-01-25 09:25:24 +0800 )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
1 follower

RSS

Stats

Asked: 2021-01-19 22:56:17 +0800

Seen: 16 times

Last updated: Jan 21

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