Run Wicket in development mode and investigate what happens in the
"Wicket Ajax Debug" dialog (right bottom corner of your browser).

**
Martin

2009/2/3 Azzeddine Daddah <[email protected]>:
> Hi,
> I've two text fields wrapped in a container. What I want to do is to let the
> user remove these fields via a link. This is my code which does not work.
> The wrapper container stills appear even the link is submitted:
>
> <html xmlns:wicket>
>    <wicket:panel>
>    <div wicket:id="container">
>    <input type="text" wicket:id="recipeIngredientQty" style="width: 15%;
> float: left; margin-right: 10px;"/>
>    <input type="text" wicket:id="recipeIngredient" style="width: 80%;
> margin-bottom: 7px;"/>
>    <a wicket:id="removeLink">[x]</a>
>    </div>
>    </wicket:panel>
> </html>
>
> public class IngredientPanel extends Panel {
>
>    /**
>     * Creates a new {...@link IngredientPanel}.
>     *
>     * @param id the panel id; may not be <code>null</code>
>     * @param model the panel model; may not be <code>null</code>
>     */
>    public IngredientPanel(String id, IModel<RecipeIngredient> model) {
>        super(id, model);
>        RecipeIngredient recipeIngredient = model.getObject();
>
>        final WebMarkupContainer container = new
> WebMarkupContainer("container", model);
>        container.setOutputMarkupId(true);
>        container.add(new RequiredTextField<String>("recipeIngredientQty",
> new Model<String>(recipeIngredient.getQuantity())));
>        container.add(new RequiredTextField<String>("recipeIngredient", new
> Model<String>(recipeIngredient.getIngredient().getName())));
>        container.add(new AjaxLink<Void>("removeLink") {
>            @Override
>            public void onClick(AjaxRequestTarget target) {
>                remove(container);
>            }
>        });
>        add(container);
>    }
> }
>
> Kind regards,
>
> Hbiloo
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to