Re: Mulitple Forms in ListView

2010-06-30 Thread TH Lim

Sorry I didn't test it before I replied. Your solution didn't work because
for non-Ajax submit both forms r submitted. Non-ajax submit submits the page
instead of individual form in Ajax style.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Mulitple-Forms-in-ListView-tp2272668p2274681.html
Sent from the Wicket - User mailing list archive at Nabble.com.

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



Re: Mulitple Forms in ListView

2010-06-30 Thread TH Lim

Thank you for providing a solution to that.

It not so much of the solution I am looking for. I am curious why it didn't
work out of the box for non-Ajax submit but it works for AjaxSubmitLink.
Basically the code to determine if the FormComponent is the child of the
container is the same but for some reasons it didn't work out for non-Ajax
submit.

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

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



Re: Mulitple Forms in ListView

2010-06-30 Thread vov

Not a best solution but it works:)

final FeedbackPanel feedback = new FeedbackPanel("feedback", new
ContainerFeedbackMessageFilter(form)
{
  @Override
  public boolean accept(FeedbackMessage message)
  {
return requiredTextField.getModel().equals(((RequiredTextField)
message.getReporter()).getModel());
  }
}); 
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Mulitple-Forms-in-ListView-tp2272668p2272729.html
Sent from the Wicket - User mailing list archive at Nabble.com.

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



Re: Mulitple Forms in ListView

2010-06-30 Thread vov

Not a best solution but it works:)

final FeedbackPanel feedback = new FeedbackPanel("feedback", new
ContainerFeedbackMessageFilter(form)
{
  @Override
  public boolean accept(FeedbackMessage message)
  {
return requiredTextField.getModel().equals(((RequiredTextField)
message.getReporter()).getModel());
  }
});
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Mulitple-Forms-in-ListView-tp2272668p2272703.html
Sent from the Wicket - User mailing list archive at Nabble.com.

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



Mulitple Forms in ListView

2010-06-29 Thread TH Lim

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.
















public MultiFormPage()
{
ListView listView = new ListView("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("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: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org