ZK不支持行的父级:<radiogroup nleps6 =“”> </radiogroup>

时间:2014-04-01 09:23:04

标签: java zk

我的网格问题是使用模型作为我无法修复的源。

在我的.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个对象的List。这个类的定义是:

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="">,尽管它显然是正确绑定的。

非常感谢。

1 个答案:

答案 0 :(得分:1)

而不是使用

<radiogroup model="@load(experiment.replicatesFlagValues)" selectedItem="@bind(experiment.replicatesFlag)" hflex="1">

尝试使用children

<radiogroup children="@load(experiment.replicatesFlagValues)" selectedItem="@bind(experiment.replicatesFlag)" hflex="1">