Re: Feedback Messages Not Getting Displayed When Using AjaxSubmitLink
, new CompoundPropertyModelDeclaration(declaration)); form.add(new Button(submitButton) { @Override public void onSubmit() { Declaration declaration = (Declaration) form.getModelObject(); declaration.setStatus(Status.OPEN); ParcelIdentification pin = declarationService.findParcelIdentification(declaration.getPin()); if (pin == null) { error(No PIN found for PIN + getFormattedPIN(declaration.getPin())); } else { if (declarationService.initiateDeclaration(declaration)) { EzdecSession.get().info(Declaration + declaration.getTxNumber() + created); setResponsePage(new DeclarationPage(declaration, 0, pin)); } else { error(Creating declaration with PIN: + declaration.getPin()); } } } }); final PINTextField pinText = new PINTextField(pin); pinText.setRequired(true); pinText.setOutputMarkupId(true); form.add(pinText); form.add(new DropDownChoice(county, Arrays.asList(County.values())) .setRequired(true) .setEnabled(false)); final WebMarkupContainer parent = new WebMarkupContainer(verifyPanelWmc); parent.setOutputMarkupPlaceholderTag(true); parent.setVisible(false); form.add(parent); final AjaxSubmitLink verifyPinLink = new AjaxSubmitLink(verifyPinLink) { @Override public void onSubmit(AjaxRequestTarget target, Form form) { Declaration declaration = (Declaration) form.getModelObject(); ParcelIdentification pid = declarationService.findParcelIdentification(declaration.getPin()); if (pid == null) { error(No PIN found for PIN + declaration.getPin()); } else { InitiateDeclarationVerifyPanel decVerifyPanel = new InitiateDeclarationVerifyPanel(verifyPanel, pid); parent.addOrReplace(decVerifyPanel); parent.setVisible(true); this.setEnabled(false); reenterPinLink.setVisible(true); target.addComponent(this); target.addComponent(parent); target.addComponent(reenterPinLink); } } }; form.add(verifyPinLink); reenterPinLink = new AjaxFallbackLink(reenterPinLink) { @Override public void onClick(AjaxRequestTarget target) { this.setOutputMarkupPlaceholderTag(true); parent.setVisible(false); verifyPinLink.setEnabled(true); target.addComponent(parent); target.addComponent(verifyPinLink); target.addComponent(pinText); target.focusComponent(pinText); this.setVisible(false); target.addComponent(this); } }; form.add(reenterPinLink); add(form); } } Does anyone know how to fix this? -- Erik van Oosten http://www.day-to-day-stuff.blogspot.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/Feedback-Messages-Not-Getting-Displayed-When-Using-AjaxSubmitLink-tp24117995p24118997.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 -- View this message in context: http://old.nabble.com/Feedback-Messages-Not-Getting-Displayed-When-Using-AjaxSubmitLink-tp24117995p26844682.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: Feedback Messages Not Getting Displayed When Using AjaxSubmitLink
reenterPinLink; public InitiateDeclarationPage() { final Declaration declaration = new Declaration(EzdecSession.getCurrentUser().getAccount(), EzdecSession.getCurrentUser(), , County.COOK, State.ILLINOIS); //final FeedbackPanel feedback = new FeedbackPanel(feedback); //feedback.setOutputMarkupId(true); //add(feedback); add(new FeedbackPanel(feedback)); final Form form = new Form(initiateDeclarationForm, new CompoundPropertyModelDeclaration(declaration)); form.add(new Button(submitButton) { @Override public void onSubmit() { Declaration declaration = (Declaration) form.getModelObject(); declaration.setStatus(Status.OPEN); ParcelIdentification pin = declarationService.findParcelIdentification(declaration.getPin()); if (pin == null) { error(No PIN found for PIN + getFormattedPIN(declaration.getPin())); } else { if (declarationService.initiateDeclaration(declaration)) { EzdecSession.get().info(Declaration + declaration.getTxNumber() + created); setResponsePage(new DeclarationPage(declaration, 0, pin)); } else { error(Creating declaration with PIN: + declaration.getPin()); } } } }); final PINTextField pinText = new PINTextField(pin); pinText.setRequired(true); pinText.setOutputMarkupId(true); form.add(pinText); form.add(new DropDownChoice(county, Arrays.asList(County.values())) .setRequired(true) .setEnabled(false)); final WebMarkupContainer parent = new WebMarkupContainer(verifyPanelWmc); parent.setOutputMarkupPlaceholderTag(true); parent.setVisible(false); form.add(parent); final AjaxSubmitLink verifyPinLink = new AjaxSubmitLink(verifyPinLink) { @Override public void onSubmit(AjaxRequestTarget target, Form form) { Declaration declaration = (Declaration) form.getModelObject(); ParcelIdentification pid = declarationService.findParcelIdentification(declaration.getPin()); if (pid == null) { error(No PIN found for PIN + declaration.getPin()); } else { InitiateDeclarationVerifyPanel decVerifyPanel = new InitiateDeclarationVerifyPanel(verifyPanel, pid); parent.addOrReplace(decVerifyPanel); parent.setVisible(true); this.setEnabled(false); reenterPinLink.setVisible(true); target.addComponent(this); target.addComponent(parent); target.addComponent(reenterPinLink); } } }; form.add(verifyPinLink); reenterPinLink = new AjaxFallbackLink(reenterPinLink) { @Override public void onClick(AjaxRequestTarget target) { this.setOutputMarkupPlaceholderTag(true); parent.setVisible(false); verifyPinLink.setEnabled(true); target.addComponent(parent); target.addComponent(verifyPinLink); target.addComponent(pinText); target.focusComponent(pinText); this.setVisible(false); target.addComponent(this); } }; form.add(reenterPinLink); add(form); } } Does anyone know how to fix this? -- Erik van Oosten http://www.day-to-day-stuff.blogspot.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/Feedback-Messages-Not-Getting-Displayed-When-Using-AjaxSubmitLink-tp24117995p24118997.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 -- View this message in context: http://old.nabble.com/Feedback-Messages-Not-Getting-Displayed-When-Using-AjaxSubmitLink-tp24117995p26844682.html Sent from the Wicket - User mailing list archive at Nabble.com
Feedback Messages Not Getting Displayed When Using AjaxSubmitLink
I am using an AjaxSubmitLink to submit form data. Using this, however, is preventing feedback messages from being displayed. My code is as follows:public class InitiateDeclarationPage extends EzdecBaseWebPage { @SpringBean private IDeclarationService declarationService; AjaxFallbackLink reenterPinLink; public InitiateDeclarationPage() { final Declaration declaration = new Declaration(EzdecSession.getCurrentUser().getAccount(), EzdecSession.getCurrentUser(), "", County.COOK, State.ILLINOIS);// final FeedbackPanel feedback = new FeedbackPanel("feedback");// feedback.setOutputMarkupId(true);// add(feedback); add(new FeedbackPanel("feedback")); final Form form = new Form("initiateDeclarationForm", new CompoundPropertyModelDeclaration(declaration)); form.add(new Button("submitButton") { @Override public void onSubmit() { Declaration declaration = (Declaration) form.getModelObject(); declaration.setStatus(Status.OPEN); ParcelIdentification pin = declarationService.findParcelIdentification(declaration.getPin()); if (pin == null) { error("No PIN found for PIN " + getFormattedPIN(declaration.getPin())); } else { if (declarationService.initiateDeclaration(declaration)) { EzdecSession.get().info("Declaration " + declaration.getTxNumber() + " created"); setResponsePage(new DeclarationPage(declaration, 0, pin)); } else { error("Creating declaration with PIN: " + declaration.getPin()); } } } }); final PINTextField pinText = new PINTextField("pin"); pinText.setRequired(true); pinText.setOutputMarkupId(true); form.add(pinText); form.add(new DropDownChoice("county", Arrays.asList(County.values())) .setRequired(true) .setEnabled(false)); final WebMarkupContainer parent = new WebMarkupContainer("verifyPanelWmc"); parent.setOutputMarkupPlaceholderTag(true); parent.setVisible(false); form.add(parent); final AjaxSubmitLink verifyPinLink = new AjaxSubmitLink("verifyPinLink") { @Override public void onSubmit(AjaxRequestTarget target, Form form) { Declaration declaration = (Declaration) form.getModelObject(); ParcelIdentification pid = declarationService.findParcelIdentification(declaration.getPin()); if (pid == null) { error("No PIN found for PIN " + declaration.getPin()); } else { InitiateDeclarationVerifyPanel decVerifyPanel = new InitiateDeclarationVerifyPanel("verifyPanel", pid); parent.addOrReplace(decVerifyPanel); parent.setVisible(true); this.setEnabled(false); reenterPinLink.setVisible(true); target.addComponent(this); target.addComponent(parent); target.addComponent(reenterPinLink); } } }; form.add(verifyPinLink); reenterPinLink = new AjaxFallbackLink("reenterPinLink") { @Override public void onClick(AjaxRequestTarget target) { this.setOutputMarkupPlaceholderTag(true); parent.setVisible(false); verifyPinLink.setEnabled(true); target.addComponent(parent); target.addComponent(verifyPinLink); target.addComponent(pinText); target.focusComponent(pinText); this.setVisible(false); target.addComponent(this); } }; form.add(reenterPinLink); add(form); }}Does anyone know how to fix this?
Re: Feedback Messages Not Getting Displayed When Using AjaxSubmitLink
You did not call target.addComponent for the feedbackpanel or any of its parents. Regards, Erik. jpalmer1...@mchsi.com schreef: I am using an AjaxSubmitLink to submit form data. Using this, however, is preventing feedback messages from being displayed. My code is as follows: public class InitiateDeclarationPage extends EzdecBaseWebPage { @SpringBean private IDeclarationService declarationService; AjaxFallbackLink reenterPinLink; public InitiateDeclarationPage() { final Declaration declaration = new Declaration(EzdecSession.getCurrentUser().getAccount(), EzdecSession.getCurrentUser(), , County.COOK, State.ILLINOIS); //final FeedbackPanel feedback = new FeedbackPanel(feedback); //feedback.setOutputMarkupId(true); //add(feedback); add(new FeedbackPanel(feedback)); final Form form = new Form(initiateDeclarationForm, new CompoundPropertyModelDeclaration(declaration)); form.add(new Button(submitButton) { @Override public void onSubmit() { Declaration declaration = (Declaration) form.getModelObject(); declaration.setStatus(Status.OPEN); ParcelIdentification pin = declarationService.findParcelIdentification(declaration.getPin()); if (pin == null) { error(No PIN found for PIN + getFormattedPIN(declaration.getPin())); } else { if (declarationService.initiateDeclaration(declaration)) { EzdecSession.get().info(Declaration + declaration.getTxNumber() + created); setResponsePage(new DeclarationPage(declaration, 0, pin)); } else { error(Creating declaration with PIN: + declaration.getPin()); } } } }); final PINTextField pinText = new PINTextField(pin); pinText.setRequired(true); pinText.setOutputMarkupId(true); form.add(pinText); form.add(new DropDownChoice(county, Arrays.asList(County.values())) .setRequired(true) .setEnabled(false)); final WebMarkupContainer parent = new WebMarkupContainer(verifyPanelWmc); parent.setOutputMarkupPlaceholderTag(true); parent.setVisible(false); form.add(parent); final AjaxSubmitLink verifyPinLink = new AjaxSubmitLink(verifyPinLink) { @Override public void onSubmit(AjaxRequestTarget target, Form form) { Declaration declaration = (Declaration) form.getModelObject(); ParcelIdentification pid = declarationService.findParcelIdentification(declaration.getPin()); if (pid == null) { error(No PIN found for PIN + declaration.getPin()); } else { InitiateDeclarationVerifyPanel decVerifyPanel = new InitiateDeclarationVerifyPanel(verifyPanel, pid); parent.addOrReplace(decVerifyPanel); parent.setVisible(true); this.setEnabled(false); reenterPinLink.setVisible(true); target.addComponent(this); target.addComponent(parent); target.addComponent(reenterPinLink); } } }; form.add(verifyPinLink); reenterPinLink = new AjaxFallbackLink(reenterPinLink) { @Override public void onClick(AjaxRequestTarget target) { this.setOutputMarkupPlaceholderTag(true); parent.setVisible(false); verifyPinLink.setEnabled(true); target.addComponent(parent); target.addComponent(verifyPinLink); target.addComponent(pinText); target.focusComponent(pinText); this.setVisible(false); target.addComponent(this); } }; form.add(reenterPinLink); add(form); } } Does anyone know how to fix this? -- Erik van Oosten http://www.day-to-day-stuff.blogspot.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Feedback Messages Not Getting Displayed When Using AjaxSubmitLink
) { this.setOutputMarkupPlaceholderTag(true); parent.setVisible(false); verifyPinLink.setEnabled(true); target.addComponent(parent); target.addComponent(verifyPinLink); target.addComponent(pinText); target.focusComponent(pinText); this.setVisible(false); target.addComponent(this); } }; form.add(reenterPinLink); add(form); } } Does anyone know how to fix this? -- Erik van Oosten http://www.day-to-day-stuff.blogspot.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/Feedback-Messages-Not-Getting-Displayed-When-Using-AjaxSubmitLink-tp24117995p24118703.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: Feedback Messages Not Getting Displayed When Using AjaxSubmitLink
I think you need to override final AjaxSubmitLink verifyPinLink = new AjaxSubmitLink(verifyPinLink) { |*onError http://wicket.sourceforge.net/apidocs/wicket/ajax/markup/html/form/AjaxSubmitLink.html#onError%28wicket.ajax.AjaxRequestTarget,%20wicket.markup.html.form.Form%29*(AjaxRequestTarget http://wicket.sourceforge.net/apidocs/wicket/ajax/AjaxRequestTarget.html target, Form http://wicket.sourceforge.net/apidocs/wicket/markup/html/form/Form.html form)| } If you have a validation error, you will get error messages and this method is called where you add the feedback panel to the target (target.addComponent()). The onSubmit() method is only called if there were no validation errors, onError() is called when there are errors. jpalmer1026 wrote: I called target.addComponent for the feedbackpanel but still no luck. My updated code is as follows: final AjaxSubmitLink verifyPinLink = new AjaxSubmitLink(verifyPinLink) { @Override public void onSubmit(AjaxRequestTarget target, Form form) { target.addComponent(feedback); onError(target, form); Declaration declaration = (Declaration) form.getModelObject(); ParcelIdentification pid = declarationService.findParcelIdentification(declaration.getPin()); if (pid == null) { error(No PIN found for PIN + declaration.getPin()); } else { InitiateDeclarationVerifyPanel decVerifyPanel = new InitiateDeclarationVerifyPanel(verifyPanel, pid); parent.addOrReplace(decVerifyPanel); parent.setVisible(true); this.setEnabled(false); reenterPinLink.setVisible(true); target.addComponent(this); target.addComponent(parent); target.addComponent(reenterPinLink); } } }; Erik van Oosten wrote: You did not call target.addComponent for the feedbackpanel or any of its parents. Regards, Erik. jpalmer1...@mchsi.com schreef: I am using an AjaxSubmitLink to submit form data. Using this, however, is preventing feedback messages from being displayed. My code is as follows: public class InitiateDeclarationPage extends EzdecBaseWebPage { @SpringBean private IDeclarationService declarationService; AjaxFallbackLink reenterPinLink; public InitiateDeclarationPage() { final Declaration declaration = new Declaration(EzdecSession.getCurrentUser().getAccount(), EzdecSession.getCurrentUser(), , County.COOK, State.ILLINOIS); //final FeedbackPanel feedback = new FeedbackPanel(feedback); //feedback.setOutputMarkupId(true); //add(feedback); add(new FeedbackPanel(feedback)); final Form form = new Form(initiateDeclarationForm, new CompoundPropertyModelDeclaration(declaration)); form.add(new Button(submitButton) { @Override public void onSubmit() { Declaration declaration = (Declaration) form.getModelObject(); declaration.setStatus(Status.OPEN); ParcelIdentification pin = declarationService.findParcelIdentification(declaration.getPin()); if (pin == null) { error(No PIN found for PIN + getFormattedPIN(declaration.getPin())); } else { if (declarationService.initiateDeclaration(declaration)) { EzdecSession.get().info(Declaration + declaration.getTxNumber() + created); setResponsePage(new DeclarationPage(declaration, 0, pin)); } else { error(Creating declaration with PIN: + declaration.getPin()); } } } }); final PINTextField pinText = new PINTextField(pin); pinText.setRequired(true); pinText.setOutputMarkupId(true); form.add(pinText); form.add(new DropDownChoice(county, Arrays.asList(County.values())) .setRequired(true) .setEnabled(false)); final WebMarkupContainer parent = new WebMarkupContainer(verifyPanelWmc); parent.setOutputMarkupPlaceholderTag(true); parent.setVisible(false); form.add(parent); final AjaxSubmitLink verifyPinLink = new AjaxSubmitLink(verifyPinLink) { @Override public void onSubmit(AjaxRequestTarget target, Form form) { Declaration declaration = (Declaration) form.getModelObject(); ParcelIdentification pid = declarationService.findParcelIdentification(declaration.getPin()); if (pid == null) { error(No PIN found for PIN + declaration.getPin()); } else {
Re: Feedback Messages Not Getting Displayed When Using AjaxSubmitLink
); form.add(new DropDownChoice(county, Arrays.asList(County.values())) .setRequired(true) .setEnabled(false)); final WebMarkupContainer parent = new WebMarkupContainer(verifyPanelWmc); parent.setOutputMarkupPlaceholderTag(true); parent.setVisible(false); form.add(parent); final AjaxSubmitLink verifyPinLink = new AjaxSubmitLink(verifyPinLink) { @Override public void onSubmit(AjaxRequestTarget target, Form form) { Declaration declaration = (Declaration) form.getModelObject(); ParcelIdentification pid = declarationService.findParcelIdentification(declaration.getPin()); if (pid == null) { error(No PIN found for PIN + declaration.getPin()); } else { InitiateDeclarationVerifyPanel decVerifyPanel = new InitiateDeclarationVerifyPanel(verifyPanel, pid); parent.addOrReplace(decVerifyPanel); parent.setVisible(true); this.setEnabled(false); reenterPinLink.setVisible(true); target.addComponent(this); target.addComponent(parent); target.addComponent(reenterPinLink); } } }; form.add(verifyPinLink); reenterPinLink = new AjaxFallbackLink(reenterPinLink) { @Override public void onClick(AjaxRequestTarget target) { this.setOutputMarkupPlaceholderTag(true); parent.setVisible(false); verifyPinLink.setEnabled(true); target.addComponent(parent); target.addComponent(verifyPinLink); target.addComponent(pinText); target.focusComponent(pinText); this.setVisible(false); target.addComponent(this); } }; form.add(reenterPinLink); add(form); } } Does anyone know how to fix this? -- Erik van Oosten http://www.day-to-day-stuff.blogspot.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/Feedback-Messages-Not-Getting-Displayed-When-Using-AjaxSubmitLink-tp24117995p24118997.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: Feedback Messages Not Getting Displayed When Using AjaxSubmitLink
public void onSubmit() { Declaration declaration = (Declaration) form.getModelObject(); declaration.setStatus(Status.OPEN); ParcelIdentification pin = declarationService.findParcelIdentification(declaration.getPin()); if (pin == null) { error(No PIN found for PIN + getFormattedPIN(declaration.getPin())); } else { if (declarationService.initiateDeclaration(declaration)) { EzdecSession.get().info(Declaration + declaration.getTxNumber() + created); setResponsePage(new DeclarationPage(declaration, 0, pin)); } else { error(Creating declaration with PIN: + declaration.getPin()); } } } }); final PINTextField pinText = new PINTextField(pin); pinText.setRequired(true); pinText.setOutputMarkupId(true); form.add(pinText); form.add(new DropDownChoice(county, Arrays.asList(County.values())) .setRequired(true) .setEnabled(false)); final WebMarkupContainer parent = new WebMarkupContainer(verifyPanelWmc); parent.setOutputMarkupPlaceholderTag(true); parent.setVisible(false); form.add(parent); final AjaxSubmitLink verifyPinLink = new AjaxSubmitLink(verifyPinLink) { @Override public void onSubmit(AjaxRequestTarget target, Form form) { Declaration declaration = (Declaration) form.getModelObject(); ParcelIdentification pid = declarationService.findParcelIdentification(declaration.getPin()); if (pid == null) { error(No PIN found for PIN + declaration.getPin()); } else { InitiateDeclarationVerifyPanel decVerifyPanel = new InitiateDeclarationVerifyPanel(verifyPanel, pid); parent.addOrReplace(decVerifyPanel); parent.setVisible(true); this.setEnabled(false); reenterPinLink.setVisible(true); target.addComponent(this); target.addComponent(parent); target.addComponent(reenterPinLink); } } }; form.add(verifyPinLink); reenterPinLink = new AjaxFallbackLink(reenterPinLink) { @Override public void onClick(AjaxRequestTarget target) { this.setOutputMarkupPlaceholderTag(true); parent.setVisible(false); verifyPinLink.setEnabled(true); target.addComponent(parent); target.addComponent(verifyPinLink); target.addComponent(pinText); target.focusComponent(pinText); this.setVisible(false); target.addComponent(this); } }; form.add(reenterPinLink); add(form); } } Does anyone know how to fix this? -- Erik van Oosten http://www.day-to-day-stuff.blogspot.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/Feedback-Messages-Not-Getting-Displayed-When-Using-AjaxSubmitLink-tp24117995p24118997.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