You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Nino Saturnino Martinez Vazquez Wael <ni...@jayway.dk> on 2007/08/27 15:23:55 UTC

Listview / input components repaint via ajax?

Hi

I have a listview in a panel. I have a ajax link to add items to the 
list. When I click the link the listview are repainted, because I have 
it  in the markupcontainer just as it should. In the listview there are 
some textfields, these are cleared when the markupcontainer are 
repainted, I dont understand why?

I have set the setReuseItems(true). And have tried to call the 
removeAll() method on the listview.

What am I forgetting?


regards Nino

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


Re: Listview / input components repaint via ajax?

Posted by Nino Saturnino Martinez Vazquez Wael <ni...@jayway.dk>.
Jep, I sorta thought that it wouldnt make sense for it to call removeAll...

regards Nino

Eelco Hillenius wrote:
>> I have a listview in a panel. I have a ajax link to add items to the
>> list. When I click the link the listview are repainted, because I have
>> it  in the markupcontainer just as it should. In the listview there are
>> some textfields, these are cleared when the markupcontainer are
>> repainted, I dont understand why?
>>
>> I have set the setReuseItems(true). And have tried to call the
>> removeAll() method on the listview.
>>     
>
> If you call removeAll, the list view will populate itself freshly
> again, so your previous input won't be remembered. Either make sure
> the models that back the items are updated, or follow another
> strategy, such as using a refreshing view with
> ReuseIfModelsEqualStrategy.
>
> Eelco
>
> ---------------------------------------------------------------------
> 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: Listview / input components repaint via ajax?

Posted by Eelco Hillenius <ee...@gmail.com>.
> I have a listview in a panel. I have a ajax link to add items to the
> list. When I click the link the listview are repainted, because I have
> it  in the markupcontainer just as it should. In the listview there are
> some textfields, these are cleared when the markupcontainer are
> repainted, I dont understand why?
>
> I have set the setReuseItems(true). And have tried to call the
> removeAll() method on the listview.

If you call removeAll, the list view will populate itself freshly
again, so your previous input won't be remembered. Either make sure
the models that back the items are updated, or follow another
strategy, such as using a refreshing view with
ReuseIfModelsEqualStrategy.

Eelco

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


Re: Listview / input components repaint via ajax?

Posted by Nino Saturnino Martinez Vazquez Wael <ni...@jayway.dk>.
Solved by a very simple solution just added 
AjaxFormComponentUpdatingBehavior, if I need to do something more 
complex i'll ask:)

regards Nino

Carlos Pita wrote:
> You can set defaultFormProcessing to false too, and post the list with an
> ajaxsubmitlink.
>
> Btw, I have written a very dynamic list that we are using for cases like
> yours. It consists of nodes that are implemented as a chained list of
> fragments, each equipped with previous, next and item placeholders
> (markupcontainers). It's ensured by construction that there will always be a
> placeholder before and after any item. You can add or insert new items,
> which you provide as fragments in a way that loosely resembles populateItem,
> a new node is then created for the item and linked to the list, and *only
> this* node is ajax painted. Similarly, you can remove nodes that are
> unlinked from the list and hidden. This way there is never a full repainting
> of the list. If you think this could be useful for you, just ask me the
> code.
>
> Regards,
> Carlos
>
> On 8/27/07, fero <fr...@gmail.com> wrote:
>   
>> Of course they are cleared, because data form textfield is transfered to
>> model only if submited with submit button. If u repaint the panel, model
>> is
>> blank. Use AjaxEditableLabel instead of TextField. It will transfer dat to
>> model immediately after editing.
>>
>> Hope it helps, i was solving this issue a week ago.
>>
>> Fero
>>
>>
>>
>> Nino Saturnino Martinez Vazquez Wael wrote:
>>     
>>> Hold for a minute, it might be something internal.
>>>
>>> I'll get back if it turns out not to be.
>>>
>>>
>>> Nino Saturnino Martinez Vazquez Wael wrote:
>>>       
>>>> Hi
>>>>
>>>> I have a listview in a panel. I have a ajax link to add items to the
>>>> list. When I click the link the listview are repainted, because I have
>>>> it  in the markupcontainer just as it should. In the listview there
>>>> are some textfields, these are cleared when the markupcontainer are
>>>> repainted, I dont understand why?
>>>>
>>>> I have set the setReuseItems(true). And have tried to call the
>>>> removeAll() method on the listview.
>>>>
>>>> What am I forgetting?
>>>>
>>>>
>>>> regards Nino
>>>>
>>>> ---------------------------------------------------------------------
>>>> 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/Listview---input-components-repaint-via-ajax--tf4335260.html#a12347341
>> 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
>>
>>
>>     
>
>   

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


Re: Listview / input components repaint via ajax?

Posted by Carlos Pita <ca...@gmail.com>.
You can set defaultFormProcessing to false too, and post the list with an
ajaxsubmitlink.

Btw, I have written a very dynamic list that we are using for cases like
yours. It consists of nodes that are implemented as a chained list of
fragments, each equipped with previous, next and item placeholders
(markupcontainers). It's ensured by construction that there will always be a
placeholder before and after any item. You can add or insert new items,
which you provide as fragments in a way that loosely resembles populateItem,
a new node is then created for the item and linked to the list, and *only
this* node is ajax painted. Similarly, you can remove nodes that are
unlinked from the list and hidden. This way there is never a full repainting
of the list. If you think this could be useful for you, just ask me the
code.

Regards,
Carlos

On 8/27/07, fero <fr...@gmail.com> wrote:
>
>
> Of course they are cleared, because data form textfield is transfered to
> model only if submited with submit button. If u repaint the panel, model
> is
> blank. Use AjaxEditableLabel instead of TextField. It will transfer dat to
> model immediately after editing.
>
> Hope it helps, i was solving this issue a week ago.
>
> Fero
>
>
>
> Nino Saturnino Martinez Vazquez Wael wrote:
> >
> > Hold for a minute, it might be something internal.
> >
> > I'll get back if it turns out not to be.
> >
> >
> > Nino Saturnino Martinez Vazquez Wael wrote:
> >> Hi
> >>
> >> I have a listview in a panel. I have a ajax link to add items to the
> >> list. When I click the link the listview are repainted, because I have
> >> it  in the markupcontainer just as it should. In the listview there
> >> are some textfields, these are cleared when the markupcontainer are
> >> repainted, I dont understand why?
> >>
> >> I have set the setReuseItems(true). And have tried to call the
> >> removeAll() method on the listview.
> >>
> >> What am I forgetting?
> >>
> >>
> >> regards Nino
> >>
> >> ---------------------------------------------------------------------
> >> 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/Listview---input-components-repaint-via-ajax--tf4335260.html#a12347341
> 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
>
>

Re: Listview / input components repaint via ajax?

Posted by Nino Saturnino Martinez Vazquez Wael <ni...@jayway.dk>.
Hmm just added AjaxFormComponentUpdatingBehavior to my text fields, this 
works nicely..

But your help pointed me the correct way.

regards Nino

fero wrote:
> Of course they are cleared, because data form textfield is transfered to
> model only if submited with submit button. If u repaint the panel, model is
> blank. Use AjaxEditableLabel instead of TextField. It will transfer dat to
> model immediately after editing.
>
> Hope it helps, i was solving this issue a week ago.
>
> Fero 
>
>
>
> Nino Saturnino Martinez Vazquez Wael wrote:
>   
>> Hold for a minute, it might be something internal.
>>
>> I'll get back if it turns out not to be.
>>
>>
>> Nino Saturnino Martinez Vazquez Wael wrote:
>>     
>>> Hi
>>>
>>> I have a listview in a panel. I have a ajax link to add items to the 
>>> list. When I click the link the listview are repainted, because I have 
>>> it  in the markupcontainer just as it should. In the listview there 
>>> are some textfields, these are cleared when the markupcontainer are 
>>> repainted, I dont understand why?
>>>
>>> I have set the setReuseItems(true). And have tried to call the 
>>> removeAll() method on the listview.
>>>
>>> What am I forgetting?
>>>
>>>
>>> regards Nino
>>>
>>> ---------------------------------------------------------------------
>>> 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
>>
>>
>>
>>     
>
>   

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


Re: Listview / input components repaint via ajax?

Posted by fero <fr...@gmail.com>.
Of course they are cleared, because data form textfield is transfered to
model only if submited with submit button. If u repaint the panel, model is
blank. Use AjaxEditableLabel instead of TextField. It will transfer dat to
model immediately after editing.

Hope it helps, i was solving this issue a week ago.

Fero 



Nino Saturnino Martinez Vazquez Wael wrote:
> 
> Hold for a minute, it might be something internal.
> 
> I'll get back if it turns out not to be.
> 
> 
> Nino Saturnino Martinez Vazquez Wael wrote:
>> Hi
>>
>> I have a listview in a panel. I have a ajax link to add items to the 
>> list. When I click the link the listview are repainted, because I have 
>> it  in the markupcontainer just as it should. In the listview there 
>> are some textfields, these are cleared when the markupcontainer are 
>> repainted, I dont understand why?
>>
>> I have set the setReuseItems(true). And have tried to call the 
>> removeAll() method on the listview.
>>
>> What am I forgetting?
>>
>>
>> regards Nino
>>
>> ---------------------------------------------------------------------
>> 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/Listview---input-components-repaint-via-ajax--tf4335260.html#a12347341
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


Re: Listview / input components repaint via ajax?

Posted by Nino Saturnino Martinez Vazquez Wael <ni...@jayway.dk>.
Hold for a minute, it might be something internal.

I'll get back if it turns out not to be.


Nino Saturnino Martinez Vazquez Wael wrote:
> Hi
>
> I have a listview in a panel. I have a ajax link to add items to the 
> list. When I click the link the listview are repainted, because I have 
> it  in the markupcontainer just as it should. In the listview there 
> are some textfields, these are cleared when the markupcontainer are 
> repainted, I dont understand why?
>
> I have set the setReuseItems(true). And have tried to call the 
> removeAll() method on the listview.
>
> What am I forgetting?
>
>
> regards Nino
>
> ---------------------------------------------------------------------
> 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