You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Steve Swinsburg <s....@lancaster.ac.uk> on 2009/01/15 18:20:45 UTC

skip item in populateItem of ListView

Hi all,

I have a situation whereby certain conditions mean I need to skip an  
item that is being rendered in a ListView.
ie inside the populateItem() method I do some processing and if that  
item fails, it shouldn't be rendered so I'd like to skip to the next  
item.

I know I *could* process the list before it reaches the ListView but  
I'd prefer not to iterate over the list twice.

Is there some way of skipping this item or not showing the item (and  
making sure none of its content is output)?


thanks,
Steve





Re: skip item in populateItem of ListView

Posted by Jeremy Thomerson <je...@wickettraining.com>.
ListItem.item.setVisibilityAllowed(false) - should work for you.

On Thu, Jan 15, 2009 at 1:16 PM, Stephen Swinsburg <
s.swinsburg@lancaster.ac.uk> wrote:

>
> I haven't tried that (yet) but once I do the checks I need it to stop
> rendering that item. So the rest of the stuff tahts meant to be rendered
> never gets processed.
> Nevermind I will do the checks before the data even reaches the
> LoadableDetachableModel feeding it.
>
> cheers.
>
>
>
>
> On 15/01/2009, at 5:32 PM, Martin Makundi wrote:
>
>  Sounds like bad design that's going to give you headaches later...
>> nevertheless, did you try setting the listItem.setVisible(false)?
>>
>> **
>> Martin
>>
>> 2009/1/15 Steve Swinsburg <s....@lancaster.ac.uk>:
>>
>>> Hi all,
>>>
>>> I have a situation whereby certain conditions mean I need to skip an item
>>> that is being rendered in a ListView.
>>> ie inside the populateItem() method I do some processing and if that item
>>> fails, it shouldn't be rendered so I'd like to skip to the next item.
>>>
>>> I know I *could* process the list before it reaches the ListView but I'd
>>> prefer not to iterate over the list twice.
>>>
>>> Is there some way of skipping this item or not showing the item (and
>>> making
>>> sure none of its content is output)?
>>>
>>>
>>> thanks,
>>> Steve
>>>
>>>
>>>
>>>
>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Jeremy Thomerson
http://www.wickettraining.com

Re: skip item in populateItem of ListView

Posted by Stephen Swinsburg <s....@lancaster.ac.uk>.
I haven't tried that (yet) but once I do the checks I need it to stop  
rendering that item. So the rest of the stuff tahts meant to be  
rendered never gets processed.
Nevermind I will do the checks before the data even reaches the  
LoadableDetachableModel feeding it.

cheers.



On 15/01/2009, at 5:32 PM, Martin Makundi wrote:

> Sounds like bad design that's going to give you headaches later...
> nevertheless, did you try setting the listItem.setVisible(false)?
>
> **
> Martin
>
> 2009/1/15 Steve Swinsburg <s....@lancaster.ac.uk>:
>> Hi all,
>>
>> I have a situation whereby certain conditions mean I need to skip  
>> an item
>> that is being rendered in a ListView.
>> ie inside the populateItem() method I do some processing and if  
>> that item
>> fails, it shouldn't be rendered so I'd like to skip to the next item.
>>
>> I know I *could* process the list before it reaches the ListView  
>> but I'd
>> prefer not to iterate over the list twice.
>>
>> Is there some way of skipping this item or not showing the item  
>> (and making
>> sure none of its content is output)?
>>
>>
>> thanks,
>> Steve
>>
>>
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>


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


Re: skip item in populateItem of ListView

Posted by Martin Makundi <ma...@koodaripalvelut.com>.
Sounds like bad design that's going to give you headaches later...
nevertheless, did you try setting the listItem.setVisible(false)?

**
Martin

2009/1/15 Steve Swinsburg <s....@lancaster.ac.uk>:
> Hi all,
>
> I have a situation whereby certain conditions mean I need to skip an item
> that is being rendered in a ListView.
> ie inside the populateItem() method I do some processing and if that item
> fails, it shouldn't be rendered so I'd like to skip to the next item.
>
> I know I *could* process the list before it reaches the ListView but I'd
> prefer not to iterate over the list twice.
>
> Is there some way of skipping this item or not showing the item (and making
> sure none of its content is output)?
>
>
> thanks,
> Steve
>
>
>
>
>

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


Re: skip item in populateItem of ListView

Posted by Erik van Oosten <e....@grons.nl>.
There is no such method as populateItem. With these components you just 
add the sub-components you want to see. In other words, you do the 
iteration yourself. See the javadoc of RepeatingView 
(http://wicket.apache.org/docs/wicket-1.3.2/wicket/apidocs/org/apache/wicket/markup/repeater/RepeatingView.html).

Regards,
     Erik.


Stephen Swinsburg wrote:
> Does RepeatingView or RefreshingView allow me to skip an item once 
> inside populateItem() ?
>
> thanks.
>
>
> On 15/01/2009, at 8:46 PM, Erik van Oosten wrote:
>
>> Perhaps it would be more natural to use RepeatingView (or 
>> RefreshingView) in such cases.
>>
>> Regards,
>>   Erik.
>>
>>
>> Steve Swinsburg wrote:
>>> Hi all,
>>>
>>> I have a situation whereby certain conditions mean I need to skip an 
>>> item that is being rendered in a ListView.
>>> ie inside the populateItem() method I do some processing and if that 
>>> item fails, it shouldn't be rendered so I'd like to skip to the next 
>>> item.
>>>
>>> I know I *could* process the list before it reaches the ListView but 
>>> I'd prefer not to iterate over the list twice.
>>>
>>> Is there some way of skipping this item or not showing the item (and 
>>> making sure none of its content is output)?
>>>
>>>
>>> thanks,
>>> Steve
>>>
--
Erik van Oosten
http://day-to-day-stuff.blogspot.com/



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


Re: skip item in populateItem of ListView

Posted by Stephen Swinsburg <s....@lancaster.ac.uk>.
Does RepeatingView or RefreshingView allow me to skip an item once  
inside populateItem() ?

thanks.


On 15/01/2009, at 8:46 PM, Erik van Oosten wrote:

> Perhaps it would be more natural to use RepeatingView (or  
> RefreshingView) in such cases.
>
> Regards,
>   Erik.
>
>
> Steve Swinsburg wrote:
>> Hi all,
>>
>> I have a situation whereby certain conditions mean I need to skip  
>> an item that is being rendered in a ListView.
>> ie inside the populateItem() method I do some processing and if  
>> that item fails, it shouldn't be rendered so I'd like to skip to  
>> the next item.
>>
>> I know I *could* process the list before it reaches the ListView  
>> but I'd prefer not to iterate over the list twice.
>>
>> Is there some way of skipping this item or not showing the item  
>> (and making sure none of its content is output)?
>>
>>
>> thanks,
>> Steve
>>
>
> -- 
> Erik van Oosten
> http://www.day-to-day-stuff.blogspot.com/
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>


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


Re: skip item in populateItem of ListView

Posted by Erik van Oosten <e....@grons.nl>.
Perhaps it would be more natural to use RepeatingView (or 
RefreshingView) in such cases.

Regards,
    Erik.


Steve Swinsburg wrote:
> Hi all,
>
> I have a situation whereby certain conditions mean I need to skip an 
> item that is being rendered in a ListView.
> ie inside the populateItem() method I do some processing and if that 
> item fails, it shouldn't be rendered so I'd like to skip to the next 
> item.
>
> I know I *could* process the list before it reaches the ListView but 
> I'd prefer not to iterate over the list twice.
>
> Is there some way of skipping this item or not showing the item (and 
> making sure none of its content is output)?
>
>
> thanks,
> Steve
>

-- 
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/


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