Sven - thank you. That solved it!

> Am 04.02.2015 um 14:14 schrieb Sven Meier <s...@meiers.net>:
> 
> 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: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 


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

Reply via email to