0

Combo box OnDouble Click Event and SelectedItem

asked 2013-07-09 12:10:14 +0800

Senthilchettyin gravatar image Senthilchettyin flag of India
2611 3 8
http://emrpms.blogspot.in...
    <combobox
                                        model="@load(vm.model1)" hflex="1" sclass="highlightcombo"
                                        value="@load(vm.selectedICD1.code)" mold="rounded"
                                        onDoubleClick="@command('onDoubleClickICDCode',type=p1)"
                                        selectedItem="@bind(vm.selectedICD1)" autodrop="true"
                                        autocomplete="true">
                                        <template name="model" var="p1">
                                            <comboitem
                                                label="@load(p1.code)" />
                                        </template>
                                    </combobox>

In the above code, i am trying to pass the selecteditem in the ondoubleclick event but it showing null in the VM. Is that possible, to pass the selected value ?

delete flag offensive retag edit

2 Answers

Sort by » oldest newest most voted
1

answered 2013-07-09 13:39:41 +0800

sjoshi gravatar image sjoshi flag of India
3493 1 8
http://zkframeworkhint.bl...

I did not get you are trying add onDoubleClick event in combobox ,i dont think this component support double click event for combobox there is not meaning to use onDoubleClick event you can use onChange

<combobox onChange=""></combobox>
link publish delete flag offensive edit
1

answered 2013-07-09 15:11:15 +0800

Senthilchettyin gravatar image Senthilchettyin flag of India
2611 3 8
http://emrpms.blogspot.in...

No it is there. I just manage the above with the following way. But still want to know the above is possible

<vlayout>
                                    <flabel value="ICD Code 1" />
                                    <combobox
                                        model="@load(vm.model1)" hflex="1" sclass="highlightcombo"
                                        value="@load(vm.selectedICD1.code)" mold="rounded"
                                        onDoubleClick="@command('onDoubleClickICDCode',type='ICD1')"
                                        selectedItem="@bind(vm.selectedICD1)" autodrop="true"
                                        autocomplete="true">
                                        <template name="model">
                                            <comboitem
                                                label="@load(each.code)" />
                                        </template>
                                    </combobox>
                                </vlayout>
                                <vlayout>
                                    <flabel value="ICD Code 2" />
                                    <combobox
                                        model="@load(vm.model2)" hflex="1" sclass="highlightcombo"
                                        value="@load(vm.selectedICD2.code)" mold="rounded"
                                        onDoubleClick="@command('onDoubleClickICDCode',type='ICD2')"
                                        selectedItem="@bind(vm.selectedICD2)" autodrop="true"
                                        autocomplete="true">
                                        <template name="model">
                                            <comboitem
                                                label="@load(each.code)" />
                                        </template>
                                    </combobox>
                                </vlayout>
                                <vlayout>
                                    <flabel value="ICD Code 3" />
                                    <combobox
                                        model="@load(vm.model3)" hflex="1" sclass="highlightcombo"
                                        value="@load(vm.selectedICD3.code)" mold="rounded"
                                        onDoubleClick="@command('onDoubleClickICDCode',type='ICD3')"
                                        selectedItem="@bind(vm.selectedICD3)" autodrop="true"
                                        autocomplete="true">
                                        <template name="model">
                                            <comboitem
                                                label="@load(each.code)" />
                                        </template>
                                    </combobox>
                                </vlayout>
                                <vlayout>
                                    <flabel value="ICD Code 4" />
                                    <combobox
                                        model="@load(vm.model4)" hflex="1" sclass="highlightcombo"
                                        value="@load(vm.selectedICD4.code)" mold="rounded"
                                        onDoubleClick="@command('onDoubleClickICDCode',type='ICD4')"
                                        selectedItem="@bind(vm.selectedICD4)" autodrop="true"
                                        autocomplete="true">
                                        <template name="model">
                                            <comboitem
                                                label="@load(each.code)" />
                                        </template>
                                    </combobox>
                                </vlayout>

And in the VM as follows

    @Command
public void onDoubleClickICDCode(@BindingParam("type") String type) {

    ICDCode icdCode = null;

    if (type.equals("ICD1"))
        icdCode = this.selectedICD1;
    if (type.equals("ICD2"))
        icdCode = this.selectedICD2;
    if (type.equals("ICD3"))
        icdCode = this.selectedICD3;
    if (type.equals("ICD4"))
        icdCode = this.selectedICD4;

    ShowWindow.showLinksReadOnlyModal(ApplicationLinks.ICDCodeCRUD,
            icdCode, "ICD");
}
link publish delete flag offensive edit

Comments

You are trying to say selecteditem and after that you are trying to get value onDubleClick it can be issue try to add same thing in Listbox selecteditem will not work with onDoubleClick because selectitem will work when item is selected only

sjoshi ( 2013-07-10 11:16:29 +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: 2013-07-09 12:10:14 +0800

Seen: 25 times

Last updated: Jul 09 '13

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