Hi,

I have multiple forms in a ListView. So in order not to show the same error
messages in all feedback panels I use ContainerFeedbackMessageFilter to
filter the error messages. This didn't work and the warning was
"Component-targetted feedback message was left unrendered. This could be
because you are missing a FeedbackPanel on the page." because I use non-Ajax
form submit. 

However, if I switch to AjaxSubmitLink the problem was solved. It worked as
expected. My question is should I use Ajax submit with multiple forms in a
ListView? Am I missing anything here because the problem didn't surface for
a page with multiple forms using non-Ajax submit. 

Thanks

/lim/

Codes are included below.

<html>
<body>
<ul>
    <li wicket:id="listView">
        <form wicket:id="form">
            <input wicket:id="textfield" />
            <div wicket:id="feedback"></div>
            <!--<input type="submit" wicket:id="submitALink" />-->
            <input type="submit"  />
        </form>
    </li>
</ul>
</body>
</html>

    public MultiFormPage()
    {
        ListView<String> listView = new ListView<String>("listView",
Arrays.asList(new String[]{"a", "b"}))
        {
            @Override
            protected void populateItem(ListItem item)
            {
                Form form  = new Form("form")
                {
                    @Override
                    protected void onSubmit()
                    {

                    }
                };
                //Form form = new Form("form");
                final FeedbackPanel feedback = new FeedbackPanel("feedback",
new ContainerFeedbackMessageFilter(form));
                /*
                form.add(new AjaxSubmitLink("submitALink")
                {
                    @Override
                    protected void onSubmit(AjaxRequestTarget target,
Form<?> form)
                    {
                        target.addComponent(feedback);
                    }

                    @Override
                    protected void onError(AjaxRequestTarget target, Form<?>
form)
                    {
                        target.addComponent(feedback);
                    }
                });
                */
                form.add(new RequiredTextField<String>("textfield", new
Model()));
                form.add(feedback.setOutputMarkupId(true));
                item.add(form);
            }
        };

        add(listView);
    }
}

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Mulitple-Forms-in-ListView-tp2272668p2272668.html
Sent from the Wicket - User mailing list archive at Nabble.com.

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

Reply via email to