This is somewhat working as wanted, but feels wrong, since I have to add the "next page" panel inorder to be able to show it later on:

public PhoneSearchPanel(String id, final IPhoneManipulationPanel gotoPage) {
       super(id);
       setOutputMarkupId(true);
       Form form = new Form("form");
       final Panel panel = this;
       add(form);
       AutoCompleteTextField phoneName = new AutoCompleteTextField(
               "phoneName", selectedPhone) {
           @Override
           protected Iterator getChoices(String input) {

return SDUTApplication.getService().findPhonesByFilter(input, null, null, null, null, null, null, null).iterator();
           }
       };
       form.add(phoneName);

       form.add(new AjaxButton("submit", form) {

           @Override
           protected void onSubmit(AjaxRequestTarget target, Form form) {
               gotoPage.setPhone(selectedPhone);
               ((Component) gotoPage).setVisible(true);
               panel.setVisible(false);
               target.addComponent(panel);
target.addComponent((Component) gotoPage, panel.getMarkupId());
           }

       });
       ((Component) gotoPage).setVisible(false);
       add(((Component) gotoPage));

   }
}


Matej Knopp wrote:
The error looks like you are trying to render a component that is not
attached to a page. You can add/remove components as much as you want,
but when it comes to render, all components have to be attached to the
page.

-Matej

On 8/7/07, Nino Saturnino Martinez Vazquez Wael <[EMAIL PROTECTED]> wrote:
Ok, I'll try to explain myself a little better.

Im using the tabs from extensions, tabs require that what you work with
are panels (otherwise I would have done this with pages).

So some of my tabs have a certain flow. Inorder to create that flow I
have to replace panels along the way, for example start with the search
panel, then replace the search panel with the edit panel.

However wicket complains that you cant add the panel via ajax with being
attached to a page, and since im replaceing not adding this cant be done?

Am I using a wrong approach on this?

regards Nino

Nino Saturnino Martinez Vazquez Wael wrote:
Hi

I have a panel I want to replace by another panel via ajax. However
when trying to replace the panel I get this message:

WicketMessage: This component is not (yet) coupled to a page. It has
to be able to find the page it is supposed to operate in before you
can call this method (Component#getMarkupId)

What should I do to avoid this?

regards Nino



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to