You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Anders Peterson <ap...@optimatika.se> on 2008/10/04 17:52:03 UTC

Re: OnChangeAjaxBehavior in ListView

Just browsed through my new copy of Wicket in Action. There are
"warnings" to use Wicket/Ajax with tables and ListView - I have both.

However the discussed problems seems to be mainly related to refreshing. 
My problem is that several component models get updated when only one 
'TextField' was edited; therefore the refreshed components gets an 
incorrect value. When/if I submit the form the usual (non ajax) way 
everything is corrected.

/Anders

Anders Peterson wrote:
> Here the code, html and Java fragments, for the <tr>. /Anders
> 
> Timo Rantalaiho wrote:
>> On Mon, 29 Sep 2008, Anders Peterson wrote:
>>   
>>> I'm using OnChangeAjaxBehavior with a TextField. The TextField is in a 
>>> table cell that is repeated using a ListView. When I change the value of 
>>> one of the TextFields more than one of the underlying models get updated 
>>> - the one that was supposed to be updated and all following in the list. 
>>> If I modify the first TextField then all underlying models get the same 
>>> value. If I modify the second then all except the first...
>>>     
>>
>> Hello,
>>
>> It sounds like all your TextFields models would be connected
>> to each other. Show us the code and we'll see.
>>
>> Best wishes,
>> Timo
> 
> 
> ------------------------------------------------------------------------
> 
> ---------------------------------------------------------------------
> 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


Re: OnChangeAjaxBehavior in ListView

Posted by jWeekend <jw...@cabouge.com>.
Anders,

If you strip out all the fancy financials and create the simplest example
that demonstrates the issue (eg use Arrays.asList to make a short list of
numeric "literals" and use TextField instead of "ContextTextField"), you'll
either solve the problem in the process or you can create a small
quickstart. Unless I have misunderstood your code, in essence, the problem
you are solving is similar (in terms of its solution) to keeping a
shopping-cart's total field updated via Ajax whenever an orderline's
quantity changes.

Regards - Cemal
http://www.jWeekend.co.uk http://jWeekend.co.uk 


Anders Peterson-2 wrote:
> 
> Just browsed through my new copy of Wicket in Action. There are
> "warnings" to use Wicket/Ajax with tables and ListView - I have both.
> 
> However the discussed problems seems to be mainly related to refreshing. 
> My problem is that several component models get updated when only one 
> 'TextField' was edited; therefore the refreshed components gets an 
> incorrect value. When/if I submit the form the usual (non ajax) way 
> everything is corrected.
> 
> /Anders
> 
> Anders Peterson wrote:
>> Here the code, html and Java fragments, for the <tr>. /Anders
>> 
>> Timo Rantalaiho wrote:
>>> On Mon, 29 Sep 2008, Anders Peterson wrote:
>>>   
>>>> I'm using OnChangeAjaxBehavior with a TextField. The TextField is in a 
>>>> table cell that is repeated using a ListView. When I change the value
>>>> of 
>>>> one of the TextFields more than one of the underlying models get
>>>> updated 
>>>> - the one that was supposed to be updated and all following in the
>>>> list. 
>>>> If I modify the first TextField then all underlying models get the same 
>>>> value. If I modify the second then all except the first...
>>>>     
>>>
>>> Hello,
>>>
>>> It sounds like all your TextFields models would be connected
>>> to each other. Show us the code and we'll see.
>>>
>>> Best wishes,
>>> Timo
>> 
>> 
>> ------------------------------------------------------------------------
>> 
>> ---------------------------------------------------------------------
>> 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
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/OnChangeAjaxBehavior-in-ListView-tp19725001p19816463.html
Sent from the Wicket - User 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