Hello everyone,

maybe someone is so kind and explain how to replace / update a panel which 
contains wicket container via ajax. My LeftToolbarPanel is looking this way 
(The java class is a simple listview):
HTML:
                        <wicket:panel>
                                   <wicket:container wicket:id="toolbarleft">
                                               <wicket:container 
wicket:id="toolbarcomponentleft"/>
                                   </wicket:container>
                        </wicket:panel>
Java:
            ...
            public LeftToolbarPanel() {
                        super("toolbarleftpanel");
                        add(new ListView("toolbarleft", leftComponents) {
                                   private static final long serialVersionUID = 
-8612783439924112109L;

                                   @Override
                                   protected void populateItem(ListItem item) {
                                               item.add((Component) 
item.getModelObject());
                                   }
                        });
                        setOutputMarkupId(true);
                        setOutputMarkupPlaceholderTag(true);
...
and I want to replace / update it this way (toolbarLeft is the panel which was 
already rendered before with some other components not being valid anymore):

                               LeftToolbarPanel leftToolbarPanel = new 
LeftToolbarPanel();
                               toolbarLeft.replaceWith(leftToolbarPanel);
                               toolbarLeft = leftToolbarPanel;
                               target.add(toolbarLeft);

My problem is that the initial rendering is working without any problems I can 
add components to the toolbar on page reload / browser refresh, but the ajax 
replacement is failing with this error:

Last cause: Failed to handle: <wicket:container 
wicket:id="toolbarcomponentleft"/>. It might be that no resolver has been 
registered to handle this special tag. But it also could be that you declared 
wicket:id=toolbarcomponentleft in your markup, but that you either did not add 
the component to your page at all, or that the hierarchy does not match.

<wicket:container wicket:id="toolbarleft">
                <wicket:container wicket:id="toolbarcomponentleft"/>
            </wicket:container>

Kind regards and thanks in advance

Tobias

Reply via email to