You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by paulstar <ri...@gmail.com> on 2012/05/31 00:32:21 UTC

Loop.populateItem() while migrating from Wicket 1.4 to 1.5

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-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Loop.populateItem() while migrating from Wicket 1.4 to 1.5

Posted by paulstar <ri...@gmail.com>.
Thanks for looking into this.  It seems to be a deployment issue.  The way I
did it is right for Wicket 1.5.  

Now I am facing an even bigger problem.  I will post another one regarding
"redirect loop".

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

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


Re: Loop.populateItem() while migrating from Wicket 1.4 to 1.5

Posted by Thomas Götz <to...@decoded.de>.
Could you please provide a quickstart?

   -Tom



On 31.05.2012, 00:32 paulstar wrote:

> 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-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 


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