Sven, I have an additional situation where I am getting an internal error. 
Could you help me in figuring out the problem?

Panel A senses the selection of an item from a user and adds the „sortable“ as 
container to the ajax target.
In addition, Panel B should be added to the ajax target, using Wicket events.

The internal error is thrown when using Wicket events to add the additional 
panel. Without the event, just calling #target.add(sortable) it works.

Panel A
*************
@Override
public void onSelect(AjaxRequestTarget target, List<String> items) {
        sortable.onRemove(target, items.get(0));
        target.add(sortable);
        send(getPage(), Broadcast.BREADTH, new DeleteItem(target));
}
Panel B
*************
public class PoiListPanel extends Panel {
        @Override
        public void onEvent(IEvent<?> event) {
                super.onEvent(event);

                if (event.getPayload() instanceof DeleteItem) {
                        DeleteItem update = (DeleteItem) event.getPayload();
                        update.getTarget().add(this);

        }       

}
Chris


> Am 04.02.2015 um 14:32 schrieb Grün Christoph <[email protected]>:
> 
> Sven - thank you. That solved it!
> 
> 
>> Am 04.02.2015 um 14:14 schrieb Sven Meier <[email protected]>:
>> 
>> Your container has to output its markup id:
>> 
>>      container.setOutputMarkupId()
>> 
>> Regards
>> Sven
>> 
>> 
>> On 04.02.2015 14:11, Chris wrote:
>>> Hi,
>>> 
>>> When the user clicks on a certain icon, a specific part of the page should 
>>> be reloaded through ajax. The icon is part of a panel, the specific part is 
>>> a webmarkupcontainer added directly to the page. I am using Wicket Events 
>>> to push the click event. However, when adding the web markup container as 
>>> target, I am getting an internal error.
>>> 
>>> -> update.getTarget().add(container);
>>> 
>>> Can someone help me to fix this?
>>> 
>>> *********************
>>> ***** PANEL *****
>>> final WebMarkupContainer suitcaseIcon = new WebMarkupContainer("icon");
>>> icon.setOutputMarkupId(true);
>>> icon.add(new AjaxEventBehavior("onclick") {
>>>     protected void onEvent(AjaxRequestTarget target) {
>>>             send(getPage(), Broadcast.BREADTH, new AddItem(target));
>>>     }
>>> });
>>> 
>>> *********************
>>> ***** PAGE *****
>>> ...
>>> WebMarkupContainer container;
>>> public HomePage() {
>>>     container = new WebMarkupContainer("container");
>>>     add(container);
>>> }
>>> 
>>> @Override
>>> public void onEvent(IEvent<?> event) {
>>>     super.onEvent(event);
>>>     if (event.getPayload() instanceof AddItem) {
>>>     AddItem update = (AddItem) event.getPayload();
>>>     update.getTarget().add(container);
>>>    }
>>> }
>>> 
>>> *********************
>>> ***** AddItem *****
>>> public class AddItem {
>>>    private final AjaxRequestTarget target;
>>> 
>>>    public AddItem(AjaxRequestTarget target) {
>>>        this.target = target;
>>>    }
>>> 
>>>    public AjaxRequestTarget getTarget() {
>>>        return target;
>>>    }
>>> }
>>> 
>>> Thanks.
>>> Chris
>> 
>> 
>> ---------------------------------------------------------------------
>> 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