Hi,

I wrote the following code to print out all the children of the an input
form.
---------------------------------------
Iterator iterator = getInputForm().iterator(new Comparator() {

                public int compare(Object o1, Object o2)
                {
                    System.out.format(":::::::::%s, %s%n", o1, o2);
                    
                    Component component1 = (Component) o1;
                    Component component2 = (Component) o2;
                    return 
component1.getId().compareTo(component2.getId());
                }
            });
            
            while(iterator.hasNext())
            {
                System.out.format("---------------Child of input form:
id=%s%n", ((Component)iterator.next()).getId());
            }
-----------------

When running, the following error occurs:
-------------------------------------------------------
[27 Nov 2008 10:38:15,325] ERROR [http-8080-6] (RequestCycle.java:1432) -
org.ap
ache.wicket.RequestCycle [Ljava.lang.Object; cannot be cast to
[Lorg.apache.wick
et.Component;
java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to
[Lorg.apache
.wicket.Component;
        at
org.apache.wicket.MarkupContainer.iterator(MarkupContainer.java:478)
.........

The code on line 478 of MarkupContainer.java is:
sorted = Arrays.asList((Component[])children);

Is it a bug of Wicket?

Thanks,
Valentine
-- 
View this message in context: 
http://www.nabble.com/Bug-of-Wicket-when-iterate-the-form-using-iterator%28%29--tp20723903p20723903.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