Hi,
you're telling PropertyModel to look up property "list" from MyPage, but
"list" is not a list, it's a model, models don't have a property "1".
Use this instead:
new Label("myLabel", new PropertyModel(list, "[1],anyProperty"))
... or:
new Label("myLabel", new PropertyModel(MyPage.this,
"list.object.[1].anyProperty"))
Regards
Sven
On 11/06/2014 05:03 PM, Patrick Davids wrote:
Hi all,
the javadoc of PropertyResolver says, map or list access is possible via
keys or index.
Accessing an map via key is no problem, but I dont get it working for
lists and index.
for instance:
MyPage extends Page{
private IModel<List<Anything>> list;
public MyPage(IModel<List<Anything>> list){
super();
this.list = list;
add(new Label("mylabel", new PropertyModel(MyPage.this,
"list[1].anyProperty")));
}
}
ends up in a Exception like this:
Last cause: No get method defined for class: class MyPage$1 expression: 1
I also made a try with "list.1.anyProperty".
Not working...
Any ideas?
best regards
Patrick
---------------------------------------------------------------------
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