Such an obvious thing :) yes, it is working now with having panel added to
form and to ART. Thanks for your help.
-Mihir.
On Fri, Sep 4, 2015, 2:53 AM Tobias Soloschenko <
tobiassolosche...@googlemail.com> wrote:
> First ;-)
>
> kind regards
>
> Tobias
>
> > Am 04.09.2015 um 08:50 schrieb Bernard :
> >
> > Your feedback component is not contained in any AJAX target. You add the
> > feedback component to the page which does not get refreshed after the
> form
> > submit.
> >
> > AJAX is preferably used to avoid what you are expecting (page refresh).
> >
> >
> >> On Fri, Sep 4, 2015 at 5:45 PM, Mihir Chhaya
> wrote:
> >>
> >> Hello,
> >>
> >> I am finding problem while submitting form on button click.
> >>
> >> I have simple login form with login button. User name and password
> fields
> >> are required. The button type is submit in html. But when I click the
> >> button the page does not show feedback messages. On clicking browser
> page
> >> refresh/reload (F5) only I see the feedback message. Could anybody
> suggest
> >> me what I am missing?
> >>
> >> Here is the page:
> >>
> >> public class Login extends WebPage {
> >>
> >>NotificationPanel feedbackPanel;
> >>
> >>public Login() {
> >>
> >>feedbackPanel = new NotificationPanel("statusbar");
> >>feedbackPanel.setOutputMarkupId(true);
> >>feedbackPanel.setMarkupId("statusbarId");
> >>add(feedbackPanel);
> >>
> >>Form form = new Form("login-form"){
> >>@Override
> >>protected void onSubmit() {
> >>super.onSubmit();
> >>System.out.println("Form onSubmit called...");
> >>}
> >>};
> >>form.setOutputMarkupId(true);
> >>add(form);
> >>form.add(userNameField("username", form));
> >>form.add(passwordField("password", form));
> >>AjaxFallbackButton submitButton = addLoginButton("login-button",
> >> form);
> >>form.add(submitButton);
> >>form.setDefaultButton(submitButton);
> >>form.setOutputMarkupId(true);
> >>}
> >>
> >>private PasswordTextField passwordField(String property, Form
> >> form) {
> >>PasswordTextField passwordTextField = new
> >> PasswordTextField(property);
> >>passwordTextField.setOutputMarkupId(true);
> >>passwordTextField.setRequired(true);
> >>passwordTextField.setMarkupId(property.concat("Id"));
> >>
> >>return passwordTextField;
> >>}
> >>
> >>private RequiredTextField userNameField(String property,
> >> Form form) {
> >>RequiredTextField userNameFld = new
> >> RequiredTextField(property) {
> >>@Override
> >>protected void onComponentTag(ComponentTag tag) {
> >>super.onComponentTag(tag);
> >>if (!isValid()) {
> >>tag.put("style", "background-color:red");
> >>}
> >>}
> >>};
> >>userNameFld.setOutputMarkupId(true);
> >>userNameFld.setMarkupId(property.concat("Id"));
> >>
> >>return userNameFld;
> >>}
> >>
> >>private AjaxFallbackButton addLoginButton(String property, Form
> >> form) {
> >>AjaxFallbackButton submitBtn = new AjaxFallbackButton(property,
> >> form) {
> >>@Override
> >>protected void onSubmit(AjaxRequestTarget target, Form
> form)
> >> {
> >>super.onSubmit(target, form);
> >>target.add(form);
> >>}
> >>};
> >>
> >>submitBtn.setDefaultFormProcessing(true);
> >>
> >>return submitBtn;
> >>}
> >> }
> >>
> >>
> >> Here is Mark up:
> >>
> >>
> >>
> >>
> >>
> >>
> >>User Name:
> >>
> >>
> >> >> placeholder="User Name" style="width:250px; text-align:left;">
> >>
> >>
> >>
> >>
> >>Password:
> >>
> >>
> >> >> placeholder="Password" style="width:250px; text-align:left;">
> >>
> >>
> >>
> >>
> >> >> wicket:id="login-button"/>
> >>
> >>
> >>
> >>
> >>
> >> Thanks,
> >> -Mihir.
> >>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>