0

Listbox selected item remain selected

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

GioZiak gravatar image GioZiak
51

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
0

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

cor3000 gravatar image cor3000
4791 2 7
ZK Team

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

Comments

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
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: 2019-10-13 01:51:01 +0800

Seen: 6 times

Last updated: Oct 14

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