And now that I *really* look at this
while (exerciseTable.iterator().hasNext()) {
WebMarkupContainer container = (WebMarkupContainer)
exerciseTable.iterator().next();
if (container.get
("exerciseSelected").getModelObjectAsString().equals(StaticData.TRUE)) {
exerciseTable.remove(container);
}
you should be removing items from you collection while iterating over it
with the iterator's own remove, not the collection's one.
On 8/26/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
>
> that is rather peculiar, could you please reproduce this in a quickstart?
>
> -igor
>
>
> On 8/26/07, pokkie <[EMAIL PROTECTED]> wrote:
> >
> >
> > I have a RepeatingView that I generate, each row is represented as a
> > WebMarkupContainer.
> > At the end of each row I add a checkbox. When the "Delete Selected"
> button
> > is called,
> > I wish to remove the selected row from the RepeatingView and update the
> > page
> > to reflect
> > this status.
> >
> > ----------------------
> > WebMarkupContainer mainExerciseItem = new
> > WebMarkupContainer(newChildId());
> >
> > add(mainExerciseItem);
> >
> > mainExerciseItem.add(new CheckBox("exerciseSelected", new
> > PropertyModel(mainMemberProgramExerciseHolder,
> > "memberProgramExerciseSelected")));
> > ----------------------
> >
> > Currently, I iterate over the items in the RepeatingView, check if they
> > are
> > selected, and
> > subsequently call remove(WebMarkupContainer).
> >
> > ----------------------
> > while (exerciseTable.iterator().hasNext()) {
> > WebMarkupContainer container = (WebMarkupContainer)
> > exerciseTable.iterator().next();
> > if
> > (container.get("exerciseSelected").getModelObjectAsString().equals(
> > StaticData.TRUE))
> > {
> > exerciseTable.remove(container);
> > }
> > ----------------------
> >
> > The problem is that it seems that after calling the remove() method, it
> > seems to be entering a loop and
> > never returns.
> >
> > I have tried to call the render() method, but haven't had any luck yet.
> >
> > Any help would be much appreciated
> >
> > -- pokkie
> > --
> > View this message in context:
> >
> http://www.nabble.com/RepeatingView-%3A-Removing-a-table-row-tf4331444.html#a12335918
> > Sent from the Wicket - User mailing list archive at Nabble.com.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>