string - Access to value of a Table Item -
i doing vaadin project , maybe it's easy question brain stop working right now.
i have table code like:
table table = new table(); table.addcontainerproperty("value", string.class, ""); table.addcontainerproperty("combo", combobox.class, null); table.additem(new object[]{"asd123", combo1}, 1); table.additem(new object[]{"asd1234", combo2}, 2);
combo1 , combo2 comboboxes, code like:
combobox combo1 = new combobox(); combo1.additem("choice 1"); combo1.additem("choice 2"); combobox combo2 = new combobox(); combo2.additem("girls"); combo2.additem("boys");
i want access item on table, , hold string. assume there string str , string str2 variables, , want (str = asd123) , (str2 = combo2's selected element).
how can that?
if can help, appreciate that.
table.getitem(itemid); // or combo2.getvalue();
however, these functions both return object values have typecast them string before using them properly.
string str = (string) table.getitem(itemid);
for further reference see vaadin table , vaadin combobox.
Comments
Post a Comment