in Wicket 1.4, this works fine:

               this.form.add(new Loop("ccformfields", ccformfields.size())
               {
                       @Override
                       protected void populateItem(LoopItem item)
                       {
                               int index = item.getIteration();
                               final CcFormPanel.FormField frag =
ccformfields.get(index);
                               item.add(new TableRow(frag));
                       }
               });


Now I am upgrading to Wicket 1.5 as such:

               this.form.add(new Loop("ccformfields", ccformfields.size())
               {
                       @Override
                       protected void populateItem(LoopItem item)
                       {
                               int index = item.getIndex();
                               final CcFormPanel.FormField frag =
ccformfields.get(index);
                               item.add(new TableRow(frag));
                       }
               });

Here are the exception:

Caused by: java.lang.IndexOutOfBoundsException: Index: 2, Size: 2
       at java.util.ArrayList.RangeCheck(Unknown Source)
       at java.util.ArrayList.get(Unknown Source)
       at
com.xxx.cc.components.CcFormPanel$1.populateItem(CcFormPanel.java:202)
       at org.apache.wicket.markup.html.list.Loop.onPopulate(Loop.java:100)
       at
org.apache.wicket.markup.repeater.AbstractRepeater.onBeforeRender(AbstractRepeater.java:119)
       at
org.apache.wicket.Component.internalBeforeRender(Component.java:993)
       at org.apache.wicket.Component.beforeRender(Component.java:1027)
       at
org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1743)
       ... 49 more

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Loop-populateItem-while-migrating-from-Wicket-1-4-to-1-5-tp4649598.html
Sent from the Users forum mailing list archive at Nabble.com.

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

Reply via email to