First time here? Check out the FAQ!
<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 ?
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>
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");
}
Asked: 2013-07-09 12:10:14 +0800
Seen: 25 times
Last updated: Jul 09 '13