I tried returning nulls for blank items from data provider but as you
said it feels like a hack because now my  GridView#populateItem()
needs to handle items with null model objects.

The way GridView behaves is confusing because it displays the entire
row of cells (some potentially blank) if the row has at least one
item. If the row has no items, then the row is not displayed. So,
GridView pads every row with empty cells but doesn't do this for every
column.

Should this be filed as a bug?

On Wed, Aug 8, 2012 at 9:37 PM, Bertrand Guay-Paquet
<ber...@step.polymtl.ca> wrote:
> 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: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to