Make use of the EmptyPanel class for the null or empty models. You could
also simply call setVisible(false) on your component if you can hide it all
together.

http://wicket.apache.org/apidocs/1.4/org/apache/wicket/markup/html/panel/Emp
tyPanel.html

~ Thank you,
  Paul Bors

-----Original Message-----
From: Bertrand Guay-Paquet [mailto:[email protected]] 
Sent: Wednesday, August 08, 2012 11:37 PM
To: [email protected]
Subject: Re: How to display a grid with empty cells

Hi,

I haven't used the GridView directly so I can't help you with it
specifically. However, have you considered modifying your provider to always
return 9 records with some having an empty placeholder? It's definitely a
"hack", but it may be worth a try.

Bertrand

On 08/08/2012 10:56 PM, Alec Swan wrote:
> Hello,
>
> I am using Wicket 1.4.17 and need to display a 3x3 table with all of 
> its cells, some of which may not have a model and hence blank. So, if 
> my DataProvider returns 0 elements than I want all 9 cells to be shown 
> as blank.
>
> I started using GridView and overrode its populateEmptyItem() method 
> to display empty cells. However, contrary to its JavaDoc "Add 
> component to an Item for which there is no model anymore and is shown 
> in a cell" this method is not being called unless a row has at least 
> one item (see GrdiView#addItems()).
>
> What would the easiest way to accomplish what I need without copying 
> the entire code from GridView class? Any other component that can do 
> that?
>
> Thanks,
>
> Alec
>
> ---------------------------------------------------------------------
> 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]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to