You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Timo Rantalaiho (JIRA)" <ji...@apache.org> on 2009/02/25 20:31:02 UTC
[jira] Issue Comment Edited: (WICKET-2126) Widen generics for
ListView model (should be List extends T> and not just List)
[ https://issues.apache.org/jira/browse/WICKET-2126?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12676746#action_12676746 ]
thrantal edited comment on WICKET-2126 at 2/25/09 11:29 AM:
-------------------------------------------------------------------
What do you mean, Igor? This test for example compiles and passes:
{code:java}
public void testSameWildcardListModelWorksForListViewAndDropDownChoice() {
new WicketTester();
IModel<List<? extends String>> model = new WildcardListModel<String>(new ArrayList<String>(Arrays.asList("foo", "bar")));
DropDownChoice<String> choice = new DropDownChoice<String>("choice", model);
ListView<String> list = new ListView<String>("listView", model)
{
@Override
protected void populateItem(ListItem<String> stringListItem)
{
throw new UnsupportedOperationException("Not implemented");
}
};
list.getModel().getObject().add("yeah");
list.getModelObject().add("rock");
assertEquals(Arrays.asList("foo", "bar", "yeah", "rock"), model.getObject());
}
{code}
was (Author: thrantal):
What do you mean, Igor? This test for example compiles and passes:
public void testSameWildcardListModelWorksForListViewAndDropDownChoice() {
new WicketTester();
IModel<List<? extends String>> model = new WildcardListModel<String>(new ArrayList<String>(Arrays.asList("foo", "bar")));
DropDownChoice<String> choice = new DropDownChoice<String>("choice", model);
ListView<String> list = new ListView<String>("listView", model)
{
@Override
protected void populateItem(ListItem<String> stringListItem)
{
throw new UnsupportedOperationException("Not implemented");
}
};
list.getModel().getObject().add("yeah");
list.getModelObject().add("rock");
assertEquals(Arrays.asList("foo", "bar", "yeah", "rock"), model.getObject());
}
> Widen generics for ListView model (should be List<? extends T> and not just List<T>)
> ------------------------------------------------------------------------------------
>
> Key: WICKET-2126
> URL: https://issues.apache.org/jira/browse/WICKET-2126
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.4-RC2
> Reporter: Timo Rantalaiho
> Assignee: Timo Rantalaiho
> Fix For: 1.4-RC3
>
> Attachments: WICKET-2126_widen_ListView_generics.patch
>
>
> See WICKET-1512
> See mailing list: http://www.nabble.com/LDM-with-Generics-for-DropDownChoice-td22155211.html
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.