Master and Detail Tables Private
About this demo
Two tables on one page, master and detail: the countries the users live in, in a JsonBasedDynamicDataTable whose rows are rendered in the browser from JSON, and the users of the country selected there, in a BeanBasedDynamicDataTable whose rows are rendered on the server by Wicket components.
- Select a country, with the check box of its row, and the table below shows its users; deselect it and it shows all of them. The master selects one row at most, setSelectionMode(SelectionMode.ONE), and onSelectionChanged refreshes the detail via Ajax
- The drop-downs above set both tables: whether their columns are resized, keeping the width of the table (ResizableColumnsBehavior with Mode.FIT) or stretching it (Mode.STRETCH); whether they take the full width (setAdjustToParentWidth(true)) or the width of their content; and whether they are stacked or side by side
- Resizing the columns of one table leaves the other alone. Stacked, the page grows with the wider table and scrolls sideways; side by side, each table scrolls sideways in its own column
Countries
Country | Code | Users |
||
|---|---|---|---|---|
All users
# | Born | City | Phones |
|||
|---|---|---|---|---|---|---|
| 1 | Alba | Rossi | 1998-06-29 | Bilbao | 890-555-4002 / 290-555-1932 | |
| 2 | Alba | Fontana | 1992-08-27 | Salto | 548-555-6075 / 475-555-1000 | |
| 3 | Alba | Rossi | 1999-04-12 | Curitiba | 619-555-1958 / 949-555-9934 | |
| 4 | Alba | Costa | 1967-04-18 | Nantes | 619-555-8473 / 267-555-6935 | |
| 5 | Alba | Alvarez | 1967-08-19 | Sendai | 409-555-5451 / 262-555-8681 | |
| 6 | Alba | Becker | 1956-11-12 | Bristol | 646-555-2734 / 629-555-5265 | |
| 7 | Alba | Novak | 1992-03-28 | Bologna | 749-555-8775 / 529-555-9220 | |
| 8 | Alba | Petrov | 1957-09-12 | Salto | 681-555-0174 / 313-555-1201 | |
| 9 | Alba | Yilmaz | 1986-01-10 | Bologna | 726-555-5109 / 906-555-8065 | |
| 10 | Alba | Weber | 1967-07-31 | Bologna | 747-555-9028 / 938-555-1659 | |