You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by pokkie <po...@gmail.com> on 2007/08/26 18:05:38 UTC
RepeatingView : Removing a table row
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-tf4331443.html#a12335916
Sent from the Wicket - User mailing list archive at Nabble.com.