我将使用模型作为无法修复的源的网格存在问题。
在我的.zul中,我有:
<grid model="@bind(vm.experiments)">
<columns>
<column label="Experiment" sort="auto" />
</columns>
<template name="model" var="experiment">
<row>
<vbox>
<hbox>
<button label="Add ChipSeq Unit"
onClick="@command('addChipSeqUnit', experiment=experiment)">
</button>
<button label="Delete Experiment"
onClick="@command('deleteExperiment', experiment=experiment)">
</button>
<button label="Edit Experiment"
onClick="@command('editExperiment', experiment=experiment)">
</button>
<radiogroup model="@load(experiment.replicatesFlagValues)"
selectedItem="@bind(experiment.replicatesFlag)"
hflex="1">
</radiogroup>
</hbox>
</vbox>
</row>
</template>
</grid>
ViewModel中的方法
getExperiments
返回一个CSExperiment
对象的列表。此类的定义是:public class CSExperiment {
private List<ChipSeqUnit> chipSeqUnits = new LinkedList<ChipSeqUnit>();
private Integer replicatesFlag;
public List<ChipSeqUnit> getChipSeqUnits() {
return chipSeqUnits;
}
public void setChipSeqUnits(List<ChipSeqUnit> chipSeqUnits) {
this.chipSeqUnits = chipSeqUnits;
}
public Integer getReplicatesFlag() {
return replicatesFlag;
}
public void setReplicatesFlag(Integer replicatesFlag) {
this.replicatesFlag = replicatesFlag;
}
public List<Integer> getReplicatesFlagValues(){
return Arrays.asList(new Integer[]{0, 1});
}
}
但是,在组成网格时,它会显示
Unsupported parent for row: <radiogroup nleps6="">
,尽管显然已正确绑定。非常感谢你。
最佳答案
而不是使用<radiogroup model="@load(experiment.replicatesFlagValues)" selectedItem="@bind(experiment.replicatesFlag)" hflex="1">
尝试使用children
<radiogroup children="@load(experiment.replicatesFlagValues)" selectedItem="@bind(experiment.replicatesFlag)" hflex="1">
关于java - ZK不支持的父行:<Radiogroup nLEPs6>,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/22781640/