Ah, perfect :)
Thank you so much for your help!
Johan Compagner wrote:
> Model model = new Model(map)
> {
> getObject()
> {
> return new List(map.entries())
> }
> }
>
> ListView lv = new ListView(x,model);
> johan
Model model = new Model(map)
{
getObject()
{
return new List(map.entries())
}
}
ListView lv = new ListView(x,model);
johan
On 5/30/07, Sven Schliesing <[EMAIL PROTECTED]> wrote:
I tried that already. But I ran into the following problem:
Caused by: java.lang.ClassCastException: java.u
I tried that already. But I ran into the following problem:
Caused by: java.lang.ClassCastException: java.util.HashMap cannot be
cast to java.util.List
at
org.apache.wicket.markup.html.list.ListView.getList(ListView.java:174)
at
org.apache.wicket.markup.html.list.ListView.getView
ahh ok change this
new ListView("list", new ArrayList>(map.entrySet()))
{
thats wrong you can't keep Map.Entry objects in a arraylist.
why not keep the map yourself?
new ListView("list", new Model(map) {
johan
On 5/30/07, Sven Schliesing <[EMAIL PROTECTED]> wrote:
Changing the code to:
new
2007/5/30, Sven Schliesing <[EMAIL PROTECTED]>:
Changing the code to:
new ListView("list", new ArrayList>(map.entrySet())) {
public void populateItem(ListItem listItem) {
Map.Entry entry = (Map.Entry)
listItem.getModelObject();
...
}
};
doesn't fix the problem. Furthermore
h
Changing the code to:
new ListView("list", new ArrayList>(map.entrySet())) {
public void populateItem(ListItem listItem) {
Map.Entry entry = (Map.Entry)
listItem.getModelObject();
...
}
};
doesn't fix the problem. Furthermore
http://java.sun.com/j2se/1.5.0/docs/api/java/util/M
no Maps are serializable
and yes your problem is the final keyword before that variable.
because you make it final so that you can reuse that in an (anonymous) inner
class
and then that Entry is placed in the session because it becomes a member of
that inner class
just remove the final keyword (a
So the problem isn't the final keyword but the fact that Maps aren't
serializable, right?
Johan Compagner wrote:
> remove the final keyword of the entry variable.
> You shouldn't keep entry objects like that then it will become members
> and an Map.Entry isn't serializeable
> because the HashMap
remove the final keyword of the entry variable.
You shouldn't keep entry objects like that then it will become members and
an Map.Entry isn't serializeable
because the HashMap doesn't serialize those (they aren't meant to be)
johan
On 5/29/07, Sven Schliesing <[EMAIL PROTECTED]> wrote:
Hi,
I
Btw: I'm using 1.3.0-incubating-SNAPSHOT if that matters.
-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to g
Hi,
I just ran into problems with a List view. The Model used for this is
actually a Map so I put in a entrySet() from the map in the ListView:
new ListView("list", new ArrayList>(map.entrySet())) {
public void populateItem(final ListItem listItem) {
final Map.Entry entry = (Map.Entry)
11 matches
Mail list logo