Hrmm...  I suspect that somewhere one of your components is holding on to a
copy of the list, and isn't modified.  Have you tried using a model, shared
between the component you want to refresh and the link that will modify the
list?  If the link modifies the list, then the component that has the same
model is added to the ajax target, it should know that the underlying list
has changed.  I shy away from any constructor that takes a list directly for
this reason - I'd rather have a model, and then use it any place that needs
access to that list.

BTW - With ListView, it would be real easy to make table rows....

add(new ListView<Foo>("list", new PropertyModel(myObject, "myListOfStuff"))
{
populateItem(ListItem<Foo> item) ....
});

HTML:
<table class="foo">
 <tr wicket:id="list">
  <td><span wicket:id="someLabelYouAddedToListItem"></span></td>
  <td><a wicket:id="someLinkYouAddedToListItem">click me</a></td>
 </tr>
</table>

Jeremy Thomerson
http://www.wickettraining.com

On Wed, May 7, 2008 at 5:21 PM, Stefan Lindner <[EMAIL PROTECTED]> wrote:

> The Loop fills the rows of a table. I have no idea how a ListView can
> generate the <tr><td>..</td></tr> structure of a table. The examlpe code
> would be a little bit complex because I use Scriptaculous (self compiled for
> wicket 1.4 enriched by generics)). After a drag operation into a table
> (generated gy a Loop) I want to redraw the table (now having one more
> Component).
> I tried to investigate in the code of a Refreshing View (DataGrid), that
> supports this functionalits (add a line to a table, add the table to the
> AjaxRequestTarget and see a new line in the table) but I did not find a
> hint.
>
> Stefan
>
> -----Ursprüngliche Nachricht-----
> Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im
> Auftrag von Jeremy Thomerson
> Gesendet: Donnerstag, 8. Mai 2008 00:07
> An: [email protected]
> Betreff: Re: Ajax and Loop
>
> Can you paste some code?  Have you tried using a ListView in combination
> with a model (rather than passing a List to the constructor of ListView)?
>
> Jeremy Thomerson
> http://www.wickettraining.com
>
> On Wed, May 7, 2008 at 4:55 PM, Stefan Lindner <[EMAIL PROTECTED]>
> wrote:
>
> > Dear wicket wizzards,
> >
> > I have a Loop on my page (creates Components from a List ot Objects).
> > Now I have an AjaxFallbackLink on my page. This link adds an Object to
> > my List and as a reaction to this action I want my Loop to be
> > repainted (showing the new object). What must I do? A simple
> > "target.addComponent(Loop.getParent())" has no effect.
> > The Components of the loop are created in the Constructor of the
> > Loop's parent. Do I have to overwrite some "beforeRender" methods? Of
> > course, I took a look at the Wicket In Action book and the Wiki and
> > the List but I did not find a hint. Can anybody help me?
> >
> > Stefan
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to