[英]How can I add a Radio Button Cell to a CellTable in GWT?
I'm trying to implement a possibility to vote either yes or no or nothing and I implemented the entry to vote for in a CellTable.我正在尝试实现对是或否或什么都不进行投票的可能性,并且在CellTable中实现了要投票的条目。 I now want to add Columns "yes" and "no" and per row I want to add two Radio Buttons.现在,我想添加“ yes”和“ no”列,并且我想为每行添加两个单选按钮。 Per default there is no way to add a Radio Button Cell?默认情况下,没有办法添加单选按钮单元吗?
I tried it like this by creating my own Button Cell but it doesn't seem to work.我通过创建自己的Button Cell进行了这样的尝试,但是它似乎不起作用。 class ButtonZelle extends AbstractCell { ButtonZelle类扩展AbstractCell {
RadioButton button;
public ButtonZelle(RadioButton button){
this.button=button;
}
@Override
public void render(RadioButton value) {
// Prüfen ob der Wert null ist
if (value == null) {
return;
}
}
}
} }
Does anyone know how to implement this correctly?有谁知道如何正确执行此操作?
Kind regards Alina亲切的问候阿丽娜(Alina)
I'm trying to implement a possibility to vote either yes or no or nothing and I implemented the entry to vote for in a CellTable.我正在尝试实现对是或否或什么都不进行投票的可能性,并且在CellTable中实现了要投票的条目。 I now want to add Columns "yes" and "no" and per row I want to add two Radio Buttons.现在,我想添加“ yes”和“ no”列,并且我想为每行添加两个单选按钮。 Per default there is no way to add a Radio Button Cell?默认情况下,没有办法添加单选按钮单元吗?
I tried it like this by creating my own Button Cell but it doesn't seem to work.我通过创建自己的Button Cell进行了这样的尝试,但是它似乎不起作用。 class ButtonZelle extends AbstractCell { ButtonZelle类扩展AbstractCell {
RadioButton button;
public ButtonZelle(RadioButton button){
this.button=button;
}
@Override
public void render(RadioButton value) {
// Prüfen ob der Wert null ist
if (value == null) {
return;
}
}
}
} }
Does anyone know how to implement this correctly?有谁知道如何正确执行此操作?
Kind regards Alina亲切的问候阿丽娜(Alina)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.