我有一個Vertiacal面板對象,這個對象包含許多單選按鈕GWT獲得組件
所以我可以得到這些RADIOBUTTON通過Vertiacal面板對象的對象。
也許通過迭代或?
private void initCourse() {
coursePopupPanel.clear();
VerticalPanel verticalPanel = new VerticalPanel();
coursePopupPanel.setWidget(verticalPanel);
JsArray<JCourse> jCourseArray = JCourse.getList(stringMainData);
for (int i = 0; i < jCourseArray.length(); i++) {
final RadioButton courseRadioButton = new RadioButton("course");
courseRadioButton.setText(jCourseArray.get(i).getName());
courseRadioButton.getElement().setId(jCourseArray.get(i).getView());
verticalPanel.add(courseRadioButton);
//handler of course radio buttons
courseRadioButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
}
});
}
}
我有一個參考coursePopupPanel。但我沒有參考垂直面板,所以我可以獲得垂直面板sonce的元素,參考coursePopupPanel。
請問你看看這個問題:http:// stackoverflow。COM /問題/ 14290240/GWT回收 - 組件 - 從-FormPanel中-verticalpanel,其中,被添加,dynamicall – Dipak