Listbox selected item remain selected

asked 2019-10-13 01:51:01 +0800

GioZiak gravatar image GioZiak

Hello ZK Forum. I have a listbox.I choose an item and then i do some editing on this.Then i click submit and the item/object that i had clicked/selected goes unselected. Any tips to stay selected? Thanks in advance.

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted

answered 2019-10-14 10:35:35 +0800

cor3000 gravatar image cor3000
6280 2 7

There are many ways to implement the functionality you describe. Without the specific code it's hard to tell what is happening in your application.

ZK doesn't need classical form-"submit" buttons so clicking one button itself won't unselect a listitem. It will move the focus to the button. But the selection state is unchanged. Inside your onClick listener you might have implemented something that changes the listitem/listbox/listmodel state. Triggering a re-rendering of the listbox. That's the kind of information required to help.

However if you really implemented a form submit button which reloads the whole page you have to store the previous selection either in a request parameter or in the session and restore when the page re-renders.

In any case: a runnable reproducing example on http://zkfiddle.org/ (I increased your karma so you can post a link) will be most helpful to assist in your specific scenario.

link publish delete flag offensive edit


Thank you for your reply.I will re-visit it. Currently i have some other issues to fix so i will leave it aside for a while.

GioZiak ( 2019-10-18 02:45:32 +0800 )edit

no worries I am watching the thread

cor3000 ( 2019-10-21 09:50:10 +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




Asked: 2019-10-13 01:51:01 +0800

Seen: 12 times

Last updated: Oct 14 '19

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