You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by kan <ka...@gmail.com> on 2008/11/21 18:45:57 UTC

ListView model is CompoundPropertyModel>

ListView model is CompoundPropertyModel<List<MyObject>>
And when I populate items such what:

protected void populateItem(final ListItem<SaleTransfer> item)
{
  item.add(new Label("fullName"));
}

I getting error:
WicketMessage:  The expression 'fullName' is neither an index nor is
it a method or field for the list class java.util.ArrayList

Why ListView doesn't set appropriate item's model to items?

-- 
WBR, kan.

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


Re: ListView model is CompoundPropertyModel>

Posted by Jeremy Thomerson <je...@wickettraining.com>.
There's a few ways:

   - Use PropertyListView
   - or override ListView and return return new
   CompoundPropertyModel<T>(super.getListItemModel(model, index)); (which is
   what the PropertyListView does)
   - or put this on your first line: item.setModel(new
   CompoundPropertyModel(item.getModel())

-- 
Jeremy Thomerson
http://www.wickettraining.com
On Fri, Nov 21, 2008 at 8:38 PM, kan <ka...@gmail.com> wrote:

> How to get appropriate item model inside populateItem method? Why
> ListView cannot do it automatically?
>
> 2008/11/21 Igor Vaynberg <ig...@gmail.com>:
>  > item's model needs to be compound, not listview's
> >
> > -igor
> >
> > On Fri, Nov 21, 2008 at 9:45 AM, kan <ka...@gmail.com> wrote:
> >> ListView model is CompoundPropertyModel<List<MyObject>>
> >> And when I populate items such what:
> >>
> >> protected void populateItem(final ListItem<SaleTransfer> item)
> >> {
> >>  item.add(new Label("fullName"));
> >> }
> >>
> >> I getting error:
> >> WicketMessage:  The expression 'fullName' is neither an index nor is
> >> it a method or field for the list class java.util.ArrayList
> >>
> >> Why ListView doesn't set appropriate item's model to items?
> >>
> >> --
> >> WBR, kan.
> >>
> >> ---------------------------------------------------------------------
> >> 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
> >
> >
>
>
>
> --
>  WBR, kan.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: ListView model is CompoundPropertyModel>

Posted by kan <ka...@gmail.com>.
How to get appropriate item model inside populateItem method? Why
ListView cannot do it automatically?

2008/11/21 Igor Vaynberg <ig...@gmail.com>:
> item's model needs to be compound, not listview's
>
> -igor
>
> On Fri, Nov 21, 2008 at 9:45 AM, kan <ka...@gmail.com> wrote:
>> ListView model is CompoundPropertyModel<List<MyObject>>
>> And when I populate items such what:
>>
>> protected void populateItem(final ListItem<SaleTransfer> item)
>> {
>>  item.add(new Label("fullName"));
>> }
>>
>> I getting error:
>> WicketMessage:  The expression 'fullName' is neither an index nor is
>> it a method or field for the list class java.util.ArrayList
>>
>> Why ListView doesn't set appropriate item's model to items?
>>
>> --
>> WBR, kan.
>>
>> ---------------------------------------------------------------------
>> 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
>
>



-- 
WBR, kan.

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


Re: ListView model is CompoundPropertyModel>

Posted by Igor Vaynberg <ig...@gmail.com>.
item's model needs to be compound, not listview's

-igor

On Fri, Nov 21, 2008 at 9:45 AM, kan <ka...@gmail.com> wrote:
> ListView model is CompoundPropertyModel<List<MyObject>>
> And when I populate items such what:
>
> protected void populateItem(final ListItem<SaleTransfer> item)
> {
>  item.add(new Label("fullName"));
> }
>
> I getting error:
> WicketMessage:  The expression 'fullName' is neither an index nor is
> it a method or field for the list class java.util.ArrayList
>
> Why ListView doesn't set appropriate item's model to items?
>
> --
> WBR, kan.
>
> ---------------------------------------------------------------------
> 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