panel2.add(form);
final TextField field = new TextField("name", "Enter your name");
form.add(field);
Submit submit = new Submit("go");
submit.setActionListener(new ActionListener() {
public boolean onAction(Control source) {
addModel("msg", "Hi " + field.getValue() + ". Your form has been saved!");
return true;
}
});
form.add(submit);
panel2.setLabel("The Second Panel");
tabbedPanel.add(panel2);
Panel panel3 = new Panel("panel3", "panel/tabbed/table-panel3.htm");
Table table = new Table("table");
table = new Table("table");
table.setClass(Table.CLASS_ITS);
table.addColumn(new Column("id"));
table.addColumn(new Column("name"));
table.addColumn(new Column("email"));
table.addColumn(new Column("investments"));
table.setPageSize(5);
table.setSortable(true);
List list = customerService.getCustomersSortedByName(100);
table.setRowList(list);
panel3.add(table);
tabbedPanel.add(panel3);
// NOTE: Save the TabbedPanel state when a new panel is activated.
// Register a listener that is notified when a different panel is selected.
tabbedPanel.setTabListener(new ActionListener() {
public boolean onAction(Control source) {
// Save the TabbedPanel state to the session
tabbedPanel.saveState(getContext());
return true;
}