You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Mark Daniel <ma...@gmail.com> on 2008/12/09 21:23:29 UTC
Newbie question
Hello all,
I'm following the wicket in action book. I'm trying the cheese store in
chapter 3. I was following along the code by reading a bit and coding a bit
on my own. The code defining the ListView for the cheese cart is originally:
add(new ListView("cart", new PropertyModel(this, "cart.cheeses")) { ... }
The way I ended up coding it was:
add(new ListView("cart", getCart().getCheeses())) { ... }
Which seems to be working fine, but If I click repeatedly fast on the 'add
to cart' link, the ArrayList in session gets its size changed correctly when
adding elements, but the ListView element size doesnt change accordingly.
Basically, the list size keeps growing on each click, but the number of
items in the ListView doesnt grow anymore.
Any ideas whats wrong?
Thanks.
Re: Newbie question
Posted by Mark Daniel <ma...@gmail.com>.
By original source, I meant I just tried it on the book source code
download.
On Wed, Dec 10, 2008 at 1:20 AM, Mark Daniel <ma...@gmail.com> wrote:
> Hi Igor,
>
> I just changed one line the original source (in my original post), and
> built a war and deployed on tomcat, and got the behavior I mentioning. I
> think they both point to the same list.
>
>
> On Wed, Dec 10, 2008 at 1:12 AM, Igor Vaynberg <ig...@gmail.com>wrote:
>
>> you gave listview a list instance, but its probably not the same
>> instance of list you are adding items to. that is why the original
>> code uses a model to give listview the list. read the models
>> chapter...
>>
>> -igor
>>
>> On Tue, Dec 9, 2008 at 12:23 PM, Mark Daniel <ma...@gmail.com> wrote:
>> > Hello all,
>> >
>> > I'm following the wicket in action book. I'm trying the cheese store in
>> > chapter 3. I was following along the code by reading a bit and coding a
>> bit
>> > on my own. The code defining the ListView for the cheese cart is
>> originally:
>> >
>> > add(new ListView("cart", new PropertyModel(this, "cart.cheeses")) { ...
>> }
>> >
>> > The way I ended up coding it was:
>> >
>> > add(new ListView("cart", getCart().getCheeses())) { ... }
>> >
>> > Which seems to be working fine, but If I click repeatedly fast on the
>> 'add
>> > to cart' link, the ArrayList in session gets its size changed correctly
>> when
>> > adding elements, but the ListView element size doesnt change
>> accordingly.
>> > Basically, the list size keeps growing on each click, but the number of
>> > items in the ListView doesnt grow anymore.
>> >
>> > Any ideas whats wrong?
>> >
>> > Thanks.
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
Re: Newbie question
Posted by Mark Daniel <ma...@gmail.com>.
Hi Igor,
I just changed one line the original source (in my original post), and built
a war and deployed on tomcat, and got the behavior I mentioning. I think
they both point to the same list.
On Wed, Dec 10, 2008 at 1:12 AM, Igor Vaynberg <ig...@gmail.com>wrote:
> you gave listview a list instance, but its probably not the same
> instance of list you are adding items to. that is why the original
> code uses a model to give listview the list. read the models
> chapter...
>
> -igor
>
> On Tue, Dec 9, 2008 at 12:23 PM, Mark Daniel <ma...@gmail.com> wrote:
> > Hello all,
> >
> > I'm following the wicket in action book. I'm trying the cheese store in
> > chapter 3. I was following along the code by reading a bit and coding a
> bit
> > on my own. The code defining the ListView for the cheese cart is
> originally:
> >
> > add(new ListView("cart", new PropertyModel(this, "cart.cheeses")) { ... }
> >
> > The way I ended up coding it was:
> >
> > add(new ListView("cart", getCart().getCheeses())) { ... }
> >
> > Which seems to be working fine, but If I click repeatedly fast on the
> 'add
> > to cart' link, the ArrayList in session gets its size changed correctly
> when
> > adding elements, but the ListView element size doesnt change accordingly.
> > Basically, the list size keeps growing on each click, but the number of
> > items in the ListView doesnt grow anymore.
> >
> > Any ideas whats wrong?
> >
> > Thanks.
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
Re: Newbie question
Posted by Igor Vaynberg <ig...@gmail.com>.
you gave listview a list instance, but its probably not the same
instance of list you are adding items to. that is why the original
code uses a model to give listview the list. read the models
chapter...
-igor
On Tue, Dec 9, 2008 at 12:23 PM, Mark Daniel <ma...@gmail.com> wrote:
> Hello all,
>
> I'm following the wicket in action book. I'm trying the cheese store in
> chapter 3. I was following along the code by reading a bit and coding a bit
> on my own. The code defining the ListView for the cheese cart is originally:
>
> add(new ListView("cart", new PropertyModel(this, "cart.cheeses")) { ... }
>
> The way I ended up coding it was:
>
> add(new ListView("cart", getCart().getCheeses())) { ... }
>
> Which seems to be working fine, but If I click repeatedly fast on the 'add
> to cart' link, the ArrayList in session gets its size changed correctly when
> adding elements, but the ListView element size doesnt change accordingly.
> Basically, the list size keeps growing on each click, but the number of
> items in the ListView doesnt grow anymore.
>
> Any ideas whats wrong?
>
> Thanks.
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org