Well, it's not really a matter of hiding and showing table columns for
convenience.  It's really more a matter of having a "selection" panel that
allows a user to select a business object (the panel puts it in a model) and
and "display" panel that displays details for the selected business object. 
The business objects - we'll say a bill in this case - could have many
different variations.  Each type might have a lot of common information
(date/time, total amount, customer name, address, etc.) but each type of
bill might have fields that others don't.  Normally, taking an OO approach,
I would create a base display panel and have bill-specific panels that
extend that base panel, adding extra columns to the "details" table when the
DataTable is created.  However, in this case, I have a "selection" panel and
a "display" panel that share a model and once they are created, that's it. 
Staying with the bill example, the selection panel displays bills (an
assortment of types) and the display panel has to show whatever is selected.

Since I originally posted this message, I got around this limitation by
creating a model that replaces a generic display panel with a more
specialized panel as needed.  But I still believe there is a need for a
DataTable that is more dynamic.  Ideally, a DataTable would take a
java.util.List or a model wrapping a List and rather than referencing that
list directly, the DataTable would use the its own getColumns() method,
making it easy to add logic as needed.


cblehman wrote:
> 
> Can't you just create a new DataTable with the new list of columns in
> the ajax call when you want to add/remove a column, then repaint the
> container holding the Table?  
> 
> -Clay
> 
> -----Original Message-----
> From: Timo Rantalaiho [mailto:[EMAIL PROTECTED] 
> Sent: Monday, January 28, 2008 10:26 PM
> To: users@wicket.apache.org
> Subject: Re: Dynamic DataTable columns
> 
> On Mon, 28 Jan 2008, UPBrandon wrote:
>> Although, in the mean time, I still have the same problem - not being
>> able
>> to change change the columns after the DataTable has been declared, at
>> render time.  Any suggestions?
> 
> Roll your own using DataView. You can take ideas from 
> DataTable but I doubt that the Column abstraction helps you
> if you want to change the columns dynamically; this is 
> probably easier done by just changing the row Item creation.
> 
> In my experience such high-level components as DataTable
> don't work well when you want a lot of control, then their
> value is more that of an example.
> 
> Best wishes,
> Timo

-- 
View this message in context: 
http://www.nabble.com/Dynamic-DataTable-columns-tp15142596p15162689.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to