Examples of JSONFunction


Examples of org.apache.wicket.ajax.json.JsonFunction

  private void appendListenerHandler(final CharSequence handler, final JSONObject attributesJson,
    final String propertyName, final String functionTemplate) throws JSONException
  {
    if (Strings.isEmpty(handler) == false)
    {
      final JsonFunction function;
      if (handler instanceof JsonFunction)
      {
        function = (JsonFunction)handler;
      }
      else
      {
        String func = String.format(functionTemplate, handler);
        function = new JsonFunction(func);
      }
      attributesJson.append(propertyName, function);
    }
  }
View Full Code Here

Examples of org.apache.wicket.ajax.json.JsonFunction

      {
        for (CharSequence dynamicExtraParameter : dynamicExtraParameters)
        {
          String func = String.format(DYNAMIC_PARAMETER_FUNCTION_TEMPLATE,
            dynamicExtraParameter);
          JsonFunction function = new JsonFunction(func);
          attributesJson.append("dep", function);
        }
      }

      if (attributes.isAsynchronous() == false)
View Full Code Here

Examples of org.apache.wicket.ajax.json.JsonFunction

  private void appendListenerHandler(final CharSequence handler, final JSONObject attributesJson,
    final String propertyName, final String functionTemplate) throws JSONException
  {
    if (Strings.isEmpty(handler) == false)
    {
      final JsonFunction function;
      if (handler instanceof JsonFunction)
      {
        function = (JsonFunction)handler;
      }
      else
      {
        String func = String.format(functionTemplate, handler);
        function = new JsonFunction(func);
      }
      attributesJson.append(propertyName, function);
    }
  }
View Full Code Here

Examples of org.apache.wicket.ajax.json.JsonFunction

      {
        for (CharSequence dynamicExtraParameter : dynamicExtraParameters)
        {
          String func = String.format(DYNAMIC_PARAMETER_FUNCTION_TEMPLATE,
            dynamicExtraParameter);
          JsonFunction function = new JsonFunction(func);
          attributesJson.append(AjaxAttributeName.DYNAMIC_PARAMETER_FUNCTION.jsonName(),
            function);
        }
      }
View Full Code Here

Examples of org.apache.wicket.ajax.json.JsonFunction

  private void appendListenerHandler(final CharSequence handler, final JSONObject attributesJson,
    final String propertyName, final String functionTemplate) throws JSONException
  {
    if (Strings.isEmpty(handler) == false)
    {
      final JsonFunction function;
      if (handler instanceof JsonFunction)
      {
        function = (JsonFunction)handler;
      }
      else
      {
        String func = String.format(functionTemplate, handler);
        function = new JsonFunction(func);
      }
      attributesJson.append(propertyName, function);
    }
  }
View Full Code Here

Examples of org.apache.wicket.ajax.json.JsonFunction

      {
        for (CharSequence dynamicExtraParameter : dynamicExtraParameters)
        {
          String func = String.format(DYNAMIC_PARAMETER_FUNCTION_TEMPLATE,
            dynamicExtraParameter);
          JsonFunction function = new JsonFunction(func);
          attributesJson.append(AjaxAttributeName.DYNAMIC_PARAMETER_FUNCTION.jsonName(),
            function);
        }
      }
View Full Code Here

Examples of org.apache.wicket.ajax.json.JsonFunction

  private void appendListenerHandler(final CharSequence handler, final JSONObject attributesJson,
    final String propertyName, final String functionTemplate) throws JSONException
  {
    if (Strings.isEmpty(handler) == false)
    {
      final JsonFunction function;
      if (handler instanceof JsonFunction)
      {
        function = (JsonFunction)handler;
      }
      else
      {
        String func = String.format(functionTemplate, handler);
        function = new JsonFunction(func);
      }
      attributesJson.append(propertyName, function);
    }
  }
View Full Code Here

Examples of org.apache.wicket.ajax.json.JsonFunction

      if (dynamicExtraParameters != null)
      {
        for (CharSequence dynamicExtraParameter : dynamicExtraParameters)
        {
          String func = String.format(DYNAMIC_PARAMETER_FUNCTION_TEMPLATE, dynamicExtraParameter);
          JsonFunction function = new JsonFunction(func);
          attributesJson.append("dep", function);
        }
      }

      if (attributes.isAsynchronous() == false)
View Full Code Here

Examples of org.apache.wicket.ajax.json.JsonFunction

      final String propertyName, final String functionTemplate)
    throws JSONException
  {
    if (Strings.isEmpty(handler) == false)
    {
      final JsonFunction function;
      if (handler instanceof JsonFunction)
      {
        function = (JsonFunction) handler;
      }
      else
      {
        String func = String.format(functionTemplate, handler);
        function = new JsonFunction(func);
      }
      attributesJson.append(propertyName, function);
    }
  }
View Full Code Here

Examples of org.apache.wicket.ajax.json.JsonFunction

        {
          CharSequence beforeHandler = ajaxCallListener.getBeforeHandler(component);
          if (Strings.isEmpty(beforeHandler) == false)
          {
            String func = String.format(BEFORE_HANDLER_FUNCTION_TEMPLATE, beforeHandler);
            JsonFunction function = new JsonFunction(func);
            attributesJson.append("bh", function);
          }

          CharSequence afterHandler = ajaxCallListener.getAfterHandler(component);
          if (Strings.isEmpty(afterHandler) == false)
          {
            String func = String.format(AFTER_HANDLER_FUNCTION_TEMPLATE, afterHandler);
            JsonFunction function = new JsonFunction(func);
            attributesJson.append("ah", function);
          }

          CharSequence successHandler = ajaxCallListener.getSuccessHandler(component);
          if (Strings.isEmpty(successHandler) == false)
          {
            String func = String.format(SUCCESS_HANDLER_FUNCTION_TEMPLATE, successHandler);
            JsonFunction function = new JsonFunction(func);
            attributesJson.append("sh", function);
          }

          CharSequence failureHandler = ajaxCallListener.getFailureHandler(component);
          if (Strings.isEmpty(failureHandler) == false)
          {
            String func = String.format(FAILURE_HANDLER_FUNCTION_TEMPLATE, failureHandler);
            JsonFunction function = new JsonFunction(func);
            attributesJson.append("fh", function);
          }

          CharSequence completeHandler = ajaxCallListener.getCompleteHandler(component);
          if (Strings.isEmpty(completeHandler) == false)
          {
            String func = String.format(COMPLETE_HANDLER_FUNCTION_TEMPLATE, completeHandler);
            JsonFunction function = new JsonFunction(func);
            attributesJson.append("coh", function);
          }

          CharSequence precondition = ajaxCallListener.getPrecondition(component);
          if (Strings.isEmpty(precondition) == false)
          {
            String func = String.format(PRECONDITION_FUNCTION_TEMPLATE, precondition);
            JsonFunction function = new JsonFunction(func);
            attributesJson.append("pre", function);
          }
        }
      }

      JSONObject extraParameters = new JSONObject();
      Iterator<Entry<String, Object>> itor = attributes.getExtraParameters()
        .entrySet()
        .iterator();
      while (itor.hasNext())
      {
        Entry<String, Object> entry = itor.next();
        String name = entry.getKey();
        Object value = entry.getValue();
        extraParameters.accumulate(name, value);
      }
      if (extraParameters.length() > 0)
      {
        attributesJson.put("ep", extraParameters);
      }

      List<CharSequence> dynamicExtraParameters = attributes.getDynamicExtraParameters();
      if (dynamicExtraParameters != null)
      {
        for (CharSequence dynamicExtraParameter : dynamicExtraParameters)
        {
          String func = String.format(DYNAMIC_PARAMETER_FUNCTION_TEMPLATE, dynamicExtraParameter);
          JsonFunction function = new JsonFunction(func);
          attributesJson.append("dep", function);
        }
      }

      if (attributes.isAsynchronous() == false)
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.