looks like you need to use ComponentFeedbackMessageFilter rather than
ContainerFeedbackMessageFilter

On Tue, Oct 13, 2009 at 10:46 AM, Peter Arnulf Lustig <uuuuu...@yahoo.de>wrote:

> yes I do it like that.
>
> But nevertheless it shows the messages everywhere on each form.
>
> check this out:
>
> public class CreateQuestionsForm extends Form {
>
>    TextField<String>    title;
>    TextArea<String>    fragestellung;
>    Model<String>        titleModel;
>    Model<String>        fragestellungModel;
>    Boolean                isUpdate    = false;
>    Question            q;
>    Model<String>        systemTagModel;
>
>    // Tag
>    TextField<String>    systemTag;
>    Link                systemTagAdd;
>
>    public CreateQuestionsForm(String id) {
>        super(id);
>        titleModel = Model.of("");
>        fragestellungModel = Model.of("");
>        title = new RequiredTextField<String>("title", titleModel);
>        fragestellung = new TextArea<String>("fragestellung",
> fragestellungModel);
>        add(title);
>        add(fragestellung);
>
>        // -- Biete Möglichkeit für Tag-Erstellung
>        Form form = new Form("systemTagForm") {
>            @Override
>            protected void onSubmit() {
>                Tagging t = new Tagging();
>                t.setTitle(systemTagModel.getObject());
>                Worker.SaveTagging(t);
>            }
>        };
>        FeedbackPanel feedbackPanel = new
> FeedbackPanel("systemTagFormFeedbackPanel");
>        feedbackPanel.setFilter(new ContainerFeedbackMessageFilter(form));
>        systemTagModel = Model.of("");
>        systemTag = new RequiredTextField<String>("systemTag",
> systemTagModel);
>        add(form.add(feedbackPanel).add(systemTag));
>
>    }
>
>    public void setUpdate(Question q) {
>        isUpdate = true;
>        this.q = q;
>        title.setModel(Model.of(q.getTitle()));
>        fragestellung.setModel(Model.of(q.getText()));
>        q.setSysTimestamp(new Date());
>    }
>
>    @Override
>    protected void onSubmit() {
>        try {
>            if (!isUpdate) {
>                q = new Question();
>            }
>            q.setText(fragestellung.getDefaultModelObjectAsString());
>            q.setTitle(title.getDefaultModelObjectAsString());
>            if (!isUpdate) {
>                Worker.SaveQuestion(q);
>            } else {
>                Worker.UpdateQuestion(q);
>            }
>            info("Frage gespeichert");
>        } catch (Exception e) {
>            error("Jemand hat diesen Datensatz schneller editiert als du und
> hat somit gewonnen. Lade den Datensatz über die Liste neu!");
>        }
>    }
> }
>
>
>
> ----- Ursprüngliche Mail ----
> Von: Pedro Santos <pedros...@gmail.com>
> An: users@wicket.apache.org
> Gesendet: Dienstag, den 13. Oktober 2009, 15:44:07 Uhr
> Betreff: Re: Many forms on one page and submit handling
>
> you can add an ComponentFeedbackPanel for each form
>
> On Tue, Oct 13, 2009 at 10:39 AM, Peter Arnulf Lustig <uuuuu...@yahoo.de
> >wrote:
>
> > Hi,
> >
> > I have one Form-Class which has one main form -- in this form I've got
> some
> > more forms. Each of them has their own submit button.
> > How can I tell wicket, that it only has to render (validation and so on)
> > only for the form, where the button was pressed?
> >
> > thanks!
> >
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > For additional commands, e-mail: users-h...@wicket.apache.org
> >
> >
>
>
> --
> Pedro Henrique Oliveira dos Santos
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
Pedro Henrique Oliveira dos Santos

Reply via email to