@Override
 public void onComponentTag(ComponentTag tag) {
   // add onclick handler to the browser
   // if clicked in the browser, the function
   // click.response(AjaxRequestTarget target) is called on the server side
   tag.put("ondblclick", "Wicket.Ajax.get({'u':'" + click.getCallbackUrl() + "'})");
   tag.put("onclick", "Wicket.Ajax.get({'u':'" + click.getCallbackUrl() + "'})");
 }
Exemple #2
0
  @Override
  public void renderHead(final Component component, final IHeaderResponse response) {
    super.renderHead(component, response);

    response.renderCSSReference(TAG_IT_CSS);
    response.renderJavaScriptReference(TAG_IT_JS);

    component.setOutputMarkupId(true);
    String id = component.getMarkupId();

    TextTemplate tagItConfig = getTagItConfig();

    Map<String, CharSequence> variables = new HashMap<String, CharSequence>();
    variables.put("componentId", id);
    variables.put("callbackUrl", getCallbackUrl());

    String script = tagItConfig.asString(variables);

    response.renderOnDomReadyJavaScript(script);
  }
Exemple #3
0
 @Override
 protected JSONObject getProperties() throws JSONException {
   JSONObject properties = super.getProperties();
   properties.put("dataUrl", behavior.getCallbackUrl());
   return properties;
 }