-
Book Overview & Buying
-
Table Of Contents
Google Web Toolkit 2 Application Development Cookbook
By :
In the EmployeeForm, we have two combo boxes — one is for the department and another is for the designation. Suppose that the designations are based on the selected department, as follows:
|
Department |
Allowable Designations |
|---|---|
|
Accounts |
Manager Officer Clerk |
|
Sales |
Manager Officer Salesman |
Manager and officer are common designations, but a clerk works only in the accounts department, and a salesman works only in the sales department. So, when the Accounts department is selected from the combo box, Salesman should not be available as an option, and similarly, when the Sales department is selected, Clerk should not be available as an option in the allowable designations.
Write the following code in the constructor:
departmentCombo.addListener(Events.SelectionChange,new Listener<BaseEvent>(){
@Override
public void handleEvent(BaseEvent be)
{
String department=departmentCombo.getSimpleValue().toString();
designationCombo.removeAll();
designationCombo...
Change the font size
Change margin width
Change background colour