Validator on combobox. How can I rollback selected item on a view?

asked 2014-05-29 22:32:36 +0800

GordonShamvey gravatar image GordonShamvey
11 1

updated 2014-05-29 22:34:48 +0800

Hi ZK team,

I have a problem:

I have a grid with combobox in each row. Some of them share comboitems. I have cases, when certain comboitem cant be selected in two comboboxes at the same time.

Thats why I need to make a validation after combobox selectedItem being changed. But when I trying to use something like that

<combobox readonly="true" model="@load(each.suitableItemsList)" selectedItem="@bind(each.selectedDart)@validator('foo.bar.Validator')>

and validation doesnt pass, binded item stays unchanged(thats correct) BUT selectedItem being changed on view(thats wrong).

Is it conceived behaviour? Could you please give me any suggestions on how can I avoid this? Or how can I rollback item selection on my view?


delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted

answered 2014-05-29 22:43:27 +0800

chillworld gravatar image chillworld flag of Belgium
5357 4 9

Strange situation,

One thing you can do is call from your validator a global command to your vm. In the vm you do a notifyChanged of the selectedDart. (or more if you have multiple issues).

It is not the way it should be, it's a work around.

Greetz chill.

link publish delete flag offensive 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

1 follower



Asked: 2014-05-29 22:32:36 +0800

Seen: 22 times

Last updated: May 29 '14

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