Okay, I get it - and now I really feel thick - LOL. I was so focused on 
'removing' columns that the concept of not adding them in the first place 
eluded me. The only issue I see is that it's the dataprovider that knows about 
certain data not present. But I think I can address that since it's an inner 
class - probably just set some Boolean. There is no way to disable/remove a 
column if there is no data to be shown?

Thanks,

Michael

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ryan Gravener
Sent: Monday, July 14, 2008 11:52 AM
To: users@wicket.apache.org
Subject: Re: Hiding table columns in DataViews?

Here is the source for adding columns to a table:

       List<IColumn> columns = new ArrayList<IColumn>();

        columns.add(new AbstractColumn(new Model("Actions"))
        {
            public void populateItem(Item cellItem, String componentId,
IModel model)
            {
                cellItem.add(new ActionPanel(componentId, model));
            }
        });

        columns.add(new PropertyColumn(new Model("ID"), "id")
        {
            @Override
            public String getCssClass()
            {
                return "numeric";
            }
        });

        columns.add(new PropertyColumn(new Model("First Name"), "firstName",
 "firstName"));

        columns.add(new PropertyColumn(new Model("Last Name"), "lastName",
"lastName")
        {
            @Override
            public String getCssClass()
            {
                return "last-name";
            }
        });

        columns.add(new PropertyColumn(new Model("Home Phone"), "homePhone"
));
        columns.add(new PropertyColumn(new Model("Cell Phone"), "cellPhone"
));


You can see that in order to add a column or hide one you would just add it
or omit adding it to the list.  So if I did not want to show Cell Phone, I
would simply not add the PropertyColum(new Model("Cell Phone"), "cellPhone")
to columns.


On Mon, Jul 14, 2008 at 2:31 PM, Michael Mehrle <[EMAIL PROTECTED]>
wrote:

> Not to be thick, but where does this show me how to hide table headers? All
> I see is a regular DataTable example.
>
>
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ryan
> Gravener
> Sent: Monday, July 14, 2008 11:28 AM
> To: users@wicket.apache.org
> Subject: Re: Hiding table columns in DataViews?
>
>
> http://wicketstuff.org/wicket13/repeater/?wicket:bookmarkablePage=:org.apache.wicket.examples.repeater.DataTablePage
>
> via
>
> http://www.google.com/search?q=wicket+datatable+example
>
>
> On Mon, Jul 14, 2008 at 1:26 PM, Michael Mehrle <[EMAIL PROTECTED]>
> wrote:
>
> > Okay, and look at exactly what? A simple example or URL to an example
> > would have helped...
> >
> > -----Original Message-----
> > From: Martijn Dashorst [mailto:[EMAIL PROTECTED]
> > Sent: Saturday, July 12, 2008 12:04 AM
> > To: users@wicket.apache.org
> > Subject: Re: Hiding table columns in DataViews?
> >
> > See DataTable and friends.
> >
> > Martijn
> >
> > On Sat, Jul 12, 2008 at 4:19 AM, Michael Mehrle <[EMAIL PROTECTED]>
> > wrote:
> > > I build a table like this:
> > >
> > >
> > >
> > > <table width="100%" cellpadding="0" cellspacing="0" border="0">
> > >
> > > <tr>
> > >
> > >                                <td class="pad5 bld"><wicket:message
> > > key="dateTitle"/></td>
> > >
> > >                                <td><wicket:message
> > > key="timeTitle"/></td>
> > >
> > >                                <td><wicket:message
> > > key="statusTitle"/></td>
> > >
> > >                                <td>&nbsp;</td>
> > >
> > >                </tr>
> > >
> > >                                <tr wicket:id="recurringEvents">
> > >
> > >                                <td wicket:id="date" class="grytop
> > > pad5">[Date]</td>
> > >
> > >                                <td wicket:id="time"
> > > class="grytop">[Time]</td>
> > >
> > >                                <td wicket:id="status"
> > > class="grytop">[Status]</td>
> > >
> > >                                <td ><a wicket:id="replyNow"
> > > class="guestlink"><span wicket:id="reply" /></a>&nbsp;</td>
> > >
> > >                </tr>
> > >
> > > </table>
> > >
> > >
> > >
> > > Now, there are certain columns I need to hide in certain
> > circumstances.
> > > I have no problem hiding the 'content' of certain columns by setting
> > the
> > > particular value to empty in my dataprovider. However, I would like to
> > > hide the entire column including the header  - how can that be done?
> > >
> > >
> > >
> > > Thanks!
> > >
> > >
> > >
> > > Michael
> > >
> > >
> >
> >
> >
> > --
> > Become a Wicket expert, learn from the best: http://wicketinaction.com
> > Apache Wicket 1.3.4 is released
> > Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> --
> Ryan Gravener
> http://twitter.com/ryangravener
>



-- 
Ryan Gravener
http://twitter.com/ryangravener

Reply via email to