Hi Martin,

thanks for the fast answer. The LeftToolbarPanel is a Panel which is added 
within a page. It contains a ListView with the two container markups. The 
information in the brackets is wrong.

I solved the issue just some minutes ago. I was adding a component to the 
ListView, but used the wrong id and not "toolbarcomponentleft". 

So everything is working fine. The Panel with the ListView can be replaced 
without any problems. :-)

kind regards

Tobias

-----Ursprüngliche Nachricht-----
Von: Martin Grigorov [mailto:mgrigo...@apache.org] 
Gesendet: Freitag, 18. Juli 2014 15:20
An: users@wicket.apache.org
Betreff: Re: Ajax update of container listview in a panel [UNSIGNIERT]

Hi Tobias,


Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov


On Fri, Jul 18, 2014 at 2:57 PM, Soloschenko, Tobias < 
tobias.solosche...@rewe-group.com> wrote:

> 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):
>

Can you confirm that LeftToolbarPanel is a ListView ?
It looks to me that it is a Panel.

If it is really a ListView then the answer is that you cannot repaint repeater 
components with AjaxRequestTarget. You need to repaint their parent.


> 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
>

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

Reply via email to