You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Martin Bednář <ma...@triax.cz> on 2009/03/02 09:43:56 UTC

ChannelTarget 2 AjaxRequestTarget

Hi all,
I need following functionality: after receiving ChannelTarget (using cometd
server) I need open ModalDialog window on client and show some information.
For this purpose I created adapter with following methods. But in standard
wicket distribution is addJavascript declared as finall (so I have self
compiled distribution of wicked without this declaration). Is there another
way how I can do it correctly ? Or it's possible to declare this method
non-finall in wicket, or create something simillar
to ChannelTargetToAjaxRequestTargetAdapter in wicket itself ?


public class ChannelTargetToAjaxRequestTargetAdapter extends
AjaxRequestTarget {

private final IChannelTarget channelTarget;

/**
 * @param target
 */
public ChannelTargetToAjaxRequestTargetAdapter(final Page page, final
IChannelTarget target) {
super(page);
this.channelTarget = target;
}

/** {@inheritDoc} */
@Override
public void addComponent(final Component component) {
channelTarget.addComponent(component);
}

@Override
public void addJavascript(final String javascript) {
channelTarget.appendJavascript(javascript);
}


... all others methods are implemented to
throw UnsupportedOperationException

Thank you
Martin