出现及时数据
a) 页面
<combobox id="comb" width="200px" onSelect="@command('onSelectOrg')" model="@load(vm.lsdictype)"
onChanging="@command('queryTypeExt',type=event.value)" selectedItem="@save(vm.allotvo.ouorg)">
<template name="model">
<comboitem label="@load(each.productname)" value="@load(each.id)">
</comboitem>
</template>
</combobox>
后台方法
/**
* 及时刷新
* @param ctype 搜索数据
* @param event 当前键盘事件
*/
@NotifyChange("lsdictype")
@Command
public void queryTypeExt(@BindingParam("type") String ctype,
@ContextParam(ContextType.TRIGGER_EVENT)InputEvent event){
List<Product> lsdictall = productService.getAll();//获取到数据
lsdictype= new ArrayList<Product>();//封装搜索到数据
for (Product product:lsdictall) {
//判断是否具有相同数据
if(product.getProductname().indexOf(ctype) > -1){ //添加进list
lsdictype.add(product);
}else{
continue;
}
}
comb.setOpen(true); //展开Combox
}
转载于:https://my.oschina.net/u/1403237/blog/362751