Hello All,
i'am trying to migrate a code from GWT to SmartGWt.
in GWT i had an HorizontalPanel,checkboxItem,and a Tree/TreeItem.
now in SmartGWT,i tried to do in the same way as the CheckBoxTree in the showcase ( http://code.google.com/p/smartgwt/so...svn1237&r=1237 ) but also applying the same logic of my ex code,in GWT.
so i 'am using : a Tree,a treeGrid, and a HLyout, a DynamicalForm for the checkBoxItem.
first : should i use a TreeGridField ? 'cause in the exmaple of the showcase,they used a Treenode [] ,but before i used to have TreeItem,so i was wondering if TreeGridField would do the same job.
any way,i'am having a problem ,'cause i don't have any checkbox,or tree..
here is my code bellow :
i'am trying to migrate a code from GWT to SmartGWt.
in GWT i had an HorizontalPanel,checkboxItem,and a Tree/TreeItem.
now in SmartGWT,i tried to do in the same way as the CheckBoxTree in the showcase ( http://code.google.com/p/smartgwt/so...svn1237&r=1237 ) but also applying the same logic of my ex code,in GWT.
so i 'am using : a Tree,a treeGrid, and a HLyout, a DynamicalForm for the checkBoxItem.
first : should i use a TreeGridField ? 'cause in the exmaple of the showcase,they used a Treenode [] ,but before i used to have TreeItem,so i was wondering if TreeGridField would do the same job.
any way,i'am having a problem ,'cause i don't have any checkbox,or tree..
here is my code bellow :
Code:
tree = new Tree();
final CheckboxItem checkBox1 = new CheckboxItem();
checkBox1.setRedrawOnChange(true);
checkBox1.setValue(true);
DynamicForm df = new DynamicForm();
df.setFields(checkBox1);
HLayout hLayout = new HLayout();
hLayout.setMargin(1);
hLayout.addChild(df);
TreeGridField field1 = new TreeGridField("employé") ;
TreeGridField field2 = new TreeGridField("employé") ;
TreeGridField field3 = new TreeGridField("employé") ;
gridBasedOnTree.setData(tree);
gridBasedOnTree.setWidth(500);
gridBasedOnTree.setHeight(400);
gridBasedOnTree.setSelectionAppearance(SelectionAppearance.CHECKBOX);
gridBasedOnTree.setAnimateFolders(true);
gridBasedOnTree.setShowPartialSelection(true);
gridBasedOnTree.setCascadeSelection(true);
gridBasedOnTree.addDrawHandler(new DrawHandler() {
public void onDraw(DrawEvent event) {
gridBasedOnTree.getTree().openAll();
}
});
gridBasedOnTree.setFields(field1,field2,field3) ;
hLayout.addChild(gridBasedOnTree);
//in my class i extend from Composite class of GWT.
initWidget(gridBasedOnTree);