1/ MyPanel needs to use it inside the anonymous class.
2/ if its final, you cant reassign it.
3/ if i remove a panel from the list (using something like MyPanel.remove())
then its not set to the correct panel.

Doesn't quite work - a bit more complicated than u'd first expect.




Scott Swank wrote:
> 
> MyPanel firstPanel = null;
> ListView featuresList = new ListView("listView", myList) {
>   protected void populateItem(ListItem item) {
>       MyPanel panel = new MyPanel("panel", item.getModelObject()));
>       if (firstPanel == null) firstPanel = panel;
>       item.add(panel);
>   }
> }.setReuseItems(true);
> 
> On Mon, May 19, 2008 at 8:46 PM, Ned Collyer <[EMAIL PROTECTED]>
> wrote:
>>
>> Hi,
>>
>> I need to get access to the first panel added to a list item in
>> onBeforeRender from its parent.
>>
>> I have the following
>>
>> ListView featuresList = new ListView("listView", myList) {
>>    protected void populateItem(ListItem item) {
>>        MyPanel panel = new MyPanel("panel", item.getModelObject()));
>>        item.add(panel);
>>    }
>> }.setReuseItems(true);
>>
>>
>> How would I go about getting the first panel added?
>>
>> Rgds
>>
>> Ned
>> --
>> View this message in context:
>> http://www.nabble.com/ListItem-queries-tp17332693p17332693.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]
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/ListItem-queries-tp17332693p17333012.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