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 >> CompoundPropertyModel<Declaration>(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-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