0

Zk Combobox onOpen Event issue

asked 2016-11-18 08:10:01 +0800

psingh gravatar image psingh flag of India
963 8

updated 2016-11-18 09:04:04 +0800

hi,

I am having 2 dependent comboboxes and want to populate the data on the selection of one combo value to another by using onOpen event. But I am getting stuck when I enter 'a' value via keyboard bydefault first item related to "a" got selected and when I press enter it is giving Null pointer because the selected item does not contain any value.

Even when I enter any letter and traverse through mouse at first time, press enter on any item then nothing gets populated on another combo and only previous data persist in both comboboxes. What can be the possible solution to overcome this issue? I have documented my code in fiddle please check it ComboBox Data Binding issue

delete flag offensive retag edit

4 Answers

Sort by ยป oldest newest most voted
0

answered 2016-11-21 10:12:19 +0800

Darksu gravatar image Darksu
1991 1 4

Hello psingh,

You should use the onChanging Event as shown at the following documentation:

https://www.zkoss.org/wiki/ZKComponentReference/Input/Combobox#TheonChangingEvent

Best Regards,

Darksu

link publish delete flag offensive edit

Comments

onChanging is not working properly in my case even not populating the data on the basis of entered value.

psingh ( 2016-11-21 11:47:51 +0800 )edit
0

answered 2016-11-26 09:26:41 +0800

Darksu gravatar image Darksu
1991 1 4

Hello psingh ,

Could you please post your code so i can help you out?

Best Regards,

Darksu

link publish delete flag offensive edit
0

answered 2016-11-27 13:16:47 +0800

psingh gravatar image psingh flag of India
963 8

Hi Darksu,

If you look at my problem there is fiddle link where you can get the whole code. See the link below:

http://zkfiddle.org/sample/184fg41/1-MVVM-dependent-comboboxes#source-1

link publish delete flag offensive edit
0

answered 2016-11-27 22:53:59 +0800

Darksu gravatar image Darksu
1991 1 4

Hello psingh ,

Please use the following:

<combobox model="@load(vm.comboModel1)" visible="@load(vm.infoFromComboboxesRequired)" autodrop="true"
            selectedItem="@bind(vm.comboValue1)" onChange="@command('combo1Selected',selected=self)">
        <template name="model">
            <comboitem label="@load(each)" value="@load(each)"/>
        </template>
    </combobox>

Best Regards,

Darksu

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

Follow
1 follower

RSS

Stats

Asked: 2016-11-18 08:10:01 +0800

Seen: 37 times

Last updated: Nov 27 '16

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