You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by Timo Rantalaiho <Ti...@ri.fi> on 2007/11/22 04:49:05 UTC

Re: [jira] Created: (WICKET-1177) partial ajax updates on repeater components

I don't know if this should really be in Jira, as partial 
Ajax updates on repeaters work without anything too special.

In your case it sounds to me you would be better off using
DataView and updating the data its IDataProvider provides.


Re: [jira] Created: (WICKET-1177) partial ajax updates on repeater components

Posted by Eelco Hillenius <ee...@gmail.com>.
On Nov 23, 2007 2:21 PM, Johan Compagner <jc...@gmail.com> wrote:
> Reuse or not is not the point i think for this case
> Because reuse is used when you rerender the complete repeater
> but that is something they dont want to happen. They only want to rerender 1
> item (or something in the item)
> But it is not that easy to get the component from that item,,

I was just thinking out loud so it might not make sense. I was
thinking that we might be able to use the reuse strategy to determine
what elements should be re-rendered. It might mean a bit of work, and
probably even API breaks, so not something for 1.3 to do.

"Iterator items = getItemReuseStrategy().getItems(itemFactory, models,
getItems());", can be compared with the current children (right before
removeAll is called), and some 'changed' property could be set on the
new items so that they could later be picked up with a visitor that
determines which elements should be re-rendered. I can imagine such an
implementation to get pretty hairy quickly, but I think it is doable
to provide such functionality transparently. Whether it is worth the
effort in this stage I'm not sure. Users are welcome to propose though
patches as well.

Eelco

Re: [jira] Created: (WICKET-1177) partial ajax updates on repeater components

Posted by Johan Compagner <jc...@gmail.com>.
Reuse or not is not the point i think for this case
Because reuse is used when you rerender the complete repeater
but that is something they dont want to happen. They only want to rerender 1
item (or something in the item)
But it is not that easy to get the component from that item,,

Thats why i propose a interface like IChangeDetector.isChanged()
and you visit your repeater childs and ask all the childs if something is
changed and if it is add it to the AjaxRequestTarget.
But then the component must be able to know if it is changed and must be
rerendered or not..

johan

On Nov 23, 2007 10:55 PM, Eelco Hillenius <ee...@gmail.com> wrote:

> On Nov 23, 2007 1:48 PM, Johan Compagner <jc...@gmail.com> wrote:
> > how do you know which item is changed?
> > Does the item itself know that? Then you can just find it by using a
> > Component visitor..
>
> What about using the reuse strategy for info like this?
>
> Eelco
>

Re: [jira] Created: (WICKET-1177) partial ajax updates on repeater components

Posted by Eelco Hillenius <ee...@gmail.com>.
On Nov 23, 2007 1:48 PM, Johan Compagner <jc...@gmail.com> wrote:
> how do you know which item is changed?
> Does the item itself know that? Then you can just find it by using a
> Component visitor..

What about using the reuse strategy for info like this?

Eelco

Re: [jira] Created: (WICKET-1177) partial ajax updates on repeater components

Posted by Johan Compagner <jc...@gmail.com>.
how do you know which item is changed?
Does the item itself know that? Then you can just find it by using a
Component visitor..

johan



On Nov 23, 2007 10:31 AM, Peter Ertl <pe...@gmx.net> wrote:

> Hello Timo,
>
> I think this should be in JIRA.
>
> It's easy to update the data in the data provider. But it's really
> complicated to only update the changed elements of the data view in
> the ajax response as there is no easy way to get only the element of
> the data view that contain changes.
>
> usually you resort to
>
>   target.addComponent(dataView)
>
> but I want to do
>
>   target.addComponent(dataViewItem)
>
> imagine you have 200 elements of the data view in the browser window
> and only one changes. you don't want to transmit all 200 elements
> again but just that one.
>
> Best regards
> Peter
>
>
>
> Am 22.11.2007 um 04:49 schrieb Timo Rantalaiho:
>
> > I don't know if this should really be in Jira, as partial
> > Ajax updates on repeaters work without anything too special.
> >
> > In your case it sounds to me you would be better off using
> > DataView and updating the data its IDataProvider provides.
>
>

Re: [jira] Created: (WICKET-1177) partial ajax updates on repeater components

Posted by Xavier Hanin <xa...@gmail.com>.
On Nov 23, 2007 10:31 AM, Peter Ertl <pe...@gmx.net> wrote:

> Hello Timo,
>
> I think this should be in JIRA.
>
> It's easy to update the data in the data provider. But it's really
> complicated to only update the changed elements of the data view in
> the ajax response as there is no easy way to get only the element of
> the data view that contain changes.
>
> usually you resort to
>
>   target.addComponent(dataView)
>
> but I want to do
>
>   target.addComponent(dataViewItem)
>
> imagine you have 200 elements of the data view in the browser window
> and only one changes. you don't want to transmit all 200 elements
> again but just that one.

+1, I had to write custom javascript to have a log component be updated with
new lines only, having something built-in in Wicket would be easier.

Xavier


>
>
> Best regards
> Peter
>
>
>
> Am 22.11.2007 um 04:49 schrieb Timo Rantalaiho:
>
> > I don't know if this should really be in Jira, as partial
> > Ajax updates on repeaters work without anything too special.
> >
> > In your case it sounds to me you would be better off using
> > DataView and updating the data its IDataProvider provides.
>
>


-- 
Xavier Hanin - Independent Java Consultant
http://xhab.blogspot.com/
http://ant.apache.org/ivy/
http://www.xoocode.org/

Re: [jira] Created: (WICKET-1177) partial ajax updates on repeater components

Posted by Peter Ertl <pe...@gmx.net>.
Hello Timo,

I think this should be in JIRA.

It's easy to update the data in the data provider. But it's really  
complicated to only update the changed elements of the data view in  
the ajax response as there is no easy way to get only the element of  
the data view that contain changes.

usually you resort to

   target.addComponent(dataView)

but I want to do

   target.addComponent(dataViewItem)

imagine you have 200 elements of the data view in the browser window  
and only one changes. you don't want to transmit all 200 elements  
again but just that one.

Best regards
Peter



Am 22.11.2007 um 04:49 schrieb Timo Rantalaiho:

> I don't know if this should really be in Jira, as partial
> Ajax updates on repeaters work without anything too special.
>
> In your case it sounds to me you would be better off using
> DataView and updating the data its IDataProvider provides.