That's not the problem.  The problem is that setVisible(false) was called - so 
that element isn't present on the rendered page at all.  He needs to call the 
method that forces a placeholder to be rendered.


Jeremy Thomerson
http://www.wickettraining.com
-- sent from a wireless device


-----Original Message-----
From: sander v F <sandervanfaas...@gmail.com>
Sent: Friday, June 19, 2009 2:06 AM
To: users@wicket.apache.org
Subject: Re: AjaxSubmitLink

Like the error says: "Make sure you called component.setOutputMarkupId(true)
on the component whose markup you are trying to update."
That would be the component with id: 'verifyPanelWmc'.

Your code:
        final WebMarkupContainer parent = new
WebMarkupContainer("verifyPanelWmc");
//        parent.setOutputMarkupId(true);
        parent.setVisible(false);
        form.add(parent);

I think you tried that already, but because the component is not visible,
the component won't be rendered and written to the response. So there
wouldn't be any component to update with ajax. That's why there's the error
"Component with id [[verifyPanelWmc9]] a was not found while trying to
perform markup update"

You should try "setOutputMarkupPlaceholderTag(true)". This will create a
placeholder so the component can be updated with ajax.





2009/6/18 <jpalmer1...@mchsi.com>

>  I am trying to use an AjaxSubmitLink to show a panel when a button is
> clicked. I am receiving the following error when I try to submit the form:
>
> Wicket.Ajax.Call.processComponent: Component with id [[verifyPanelWmc9]] a
> was not found while trying to perform markup update. Make sure you called
> component.setOutputMarkupId(true) on the component whose markup you are
> trying to update.
>
> My code is as follows:
>
> public class InitiateDeclarationPage extends EzdecBaseWebPage {
>     @SpringBean
>     private IDeclarationService declarationService;
>
>     public InitiateDeclarationPage() {
>         final Declaration declaration = new
> Declaration(EzdecSession.getCurrentUser().getAccount(),
>                 EzdecSession.getCurrentUser(), "", County.COOK,
> State.ILLINOIS);
>         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 EzdecRequiredTextField pinText = new
> EzdecRequiredTextField("pin");
>         form.add(pinText);
>
>         form.add(new DropDownChoice("county",
> Arrays.asList(County.values()))
>                  .setRequired(true)
>                  .setEnabled(false));
>
>         final WebMarkupContainer parent = new
> WebMarkupContainer("verifyPanelWmc");
> //        parent.setOutputMarkupId(true);
>         parent.setVisible(false);
>         form.add(parent);
>
>         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 {
> //                    parent.setOutputMarkupId(true);
>                     InitiateDeclarationVerifyPanel decVerifyPanel = new
> InitiateDeclarationVerifyPanel("verifyPanel", pid);
>                     decVerifyPanel.setOutputMarkupId(true);
>                     decVerifyPanel.setVisible(true);
>                     parent.add(decVerifyPanel);
>                     parent.setVisible(true);
>                     target.addComponent(decVerifyPanel);
> //                    target.addComponent(parent);
>                 }
>             }
>         };
>
>         form.add(verifyPinLink);
>
>         add(form);
>     }
>
> }
>
> Anyone know how I can get around this?
>


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

Reply via email to