You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Java Programmer <jp...@gmail.com> on 2008/02/10 20:24:21 UTC

Problem with two FeedbackPanels on same page

Hello,
I have 2 classes which extends Panel, and both have forms on them eg:
public class AddAdvertisementPanel extends Panel {
	
	public AddAdvertisementPanel(String id) {
		super(id);
		feedback = new FeedbackPanel("feedback_add_advert").setOutputMarkupId(true);
		Form form = new Form("add_advert_form") {
			@Override
			protected void onSubmit() {
                                ...
			}
		};
		form.add(new TextField("title", new PropertyModel(this,
"title")).setRequired(true));
		add(feedback);
		add(form);
	}
}
the other one looks similar but have other names:
	feedback = new FeedbackPanel("feedback_register_user").setOutputMarkupId(true);
	Form form = new Form("register_user_form");

Both classes are instantiated on same page as panels - problem is when
I submit the one form errors appears on both FeedbackPanels, but they
only consider one form eg:

Add new advertisement:

    * Field 'title' is required.
    * Field 'body' is required.

[first form here]
Register new user:

    * Field 'title' is required.
    * Field 'body' is required.
[second form here]

Why such situation have place? As I read about wicket nesting
components should have been "wired" to their panels, but in my case I
appear as they are global, and I could not have 2 FeedbackPanels on
one page? Anyone can explain me that?

Best regards,
Adr

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Problem with two FeedbackPanels on same page

Posted by Java Programmer <jp...@gmail.com>.
On Sun, Feb 10, 2008 at 9:24 PM, richardwilko
<ri...@gmail.com> wrote:
>
>  Ive not tried it myself but this might help you
>  http://cwiki.apache.org/WICKET/using-more-than-one-feedbackpanel-per-page.html
>
>  Richard

It works perfectly thanks. BTW could there be any performance loss
when using this filter? Maybe it would be better to stay away from
such situations?

Best regards and thx,
Adr

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Problem with two FeedbackPanels on same page

Posted by richardwilko <ri...@gmail.com>.
Ive not tried it myself but this might help you
http://cwiki.apache.org/WICKET/using-more-than-one-feedbackpanel-per-page.html

Richard



Java Programmer wrote:
> 
> Hello,
> I have 2 classes which extends Panel, and both have forms on them eg:
> public class AddAdvertisementPanel extends Panel {
> 	
> 	public AddAdvertisementPanel(String id) {
> 		super(id);
> 		feedback = new
> FeedbackPanel("feedback_add_advert").setOutputMarkupId(true);
> 		Form form = new Form("add_advert_form") {
> 			@Override
> 			protected void onSubmit() {
>                                 ...
> 			}
> 		};
> 		form.add(new TextField("title", new PropertyModel(this,
> "title")).setRequired(true));
> 		add(feedback);
> 		add(form);
> 	}
> }
> the other one looks similar but have other names:
> 	feedback = new
> FeedbackPanel("feedback_register_user").setOutputMarkupId(true);
> 	Form form = new Form("register_user_form");
> 
> Both classes are instantiated on same page as panels - problem is when
> I submit the one form errors appears on both FeedbackPanels, but they
> only consider one form eg:
> 
> Add new advertisement:
> 
>     * Field 'title' is required.
>     * Field 'body' is required.
> 
> [first form here]
> Register new user:
> 
>     * Field 'title' is required.
>     * Field 'body' is required.
> [second form here]
> 
> Why such situation have place? As I read about wicket nesting
> components should have been "wired" to their panels, but in my case I
> appear as they are global, and I could not have 2 FeedbackPanels on
> one page? Anyone can explain me that?
> 
> Best regards,
> Adr
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Problem-with-two-FeedbackPanels-on-same-page-tp15400141p15400911.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org