Package org.apache.myfaces.trinidadinternal.ui.collection

Examples of org.apache.myfaces.trinidadinternal.ui.collection.Parameter


      if (params != null)
      {
        map = new String[params.length * 2];
        for (int i = 0, j = 0; i < params.length; i++)
        {
          Parameter p = params[i];
          map[j++] = p.getKey();
          map[j++] = p.getValue(context);
        }
        return map;
      }
      else
      {
View Full Code Here


    if (gotParams)
    {
      for (int i = 0; i < parameters.length; i++)
      {
        Parameter param = parameters[i];
        String paramKey = param.getKey();

        // If the ClientAction sets source or event, don't allow a parameter
        // to override it. If it's sent in, it's an attribute and the client
        // should set the value on the clientAction, not in a parameter.
        if (gotEvent && paramKey.equalsIgnoreCase("event"))
          continue;

        if (gotSource && paramKey.equalsIgnoreCase("source"))
          continue;

        // append a comma to separate the fields
        if (!firstParameter)
          buffer.append(',');
        else
          firstParameter = false;

        // Really, we shouldn't need the quotes here at all, unless
        // "paramKey" is invalid.
        buffer.append("'");
        buffer.append(paramKey);
        buffer.append("':'");

        String value = param.getValue(context);
        // BUG 3557710 - FORM ENCODER AND POSTBACK HANDLING
        String encodedValue =
          XhtmlLafUtils.getFormEncodedParameter(formEncoder, formName,
                                                paramKey, value);
        if (encodedValue != null)
View Full Code Here

    // Leave room for the open/close braces
    int length = 2;

    for (int i = 0; i < parameters.length; i++)
    {
      Parameter param = parameters[i];
      length += param.getKey().length();

      String value = param.getValue(context);
      if (value != null)
        length += value.length();

      // Make sure there is room so that we can quote the key/value
      length += 4;
View Full Code Here

     UINode node,
     BoundValue binding,
     String param,
     String paramName)
  {
    Parameter parameter = new Parameter();
    parameter.setKey(paramName);
    parameter.setValue(param);
    parameter.setValueBinding(binding);
    return parameter;
  }
View Full Code Here

    // Get the encoded names for our event parameters
    URLEncoder encoder = context.getURLEncoder();
    String eventKey  = encoder.encodeParameter(UIConstants.EVENT_PARAM);
    String sourceKey = encoder.encodeParameter(UIConstants.SOURCE_PARAM);

    Parameter eventParam = ActionUtils.buildParameter(context, node,
                                                      _eventBinding, _event,
                                                      eventKey);
    int numParams = 1;

    // If the parent element doesn't have a name or ID, there'll be no source
    Parameter sourceParam = null;
    if ((_sourceBinding != null) || (_source != null))
    {
      sourceParam = ActionUtils.buildParameter(context, node,
                                               _sourceBinding, _source,
                                               sourceKey);
View Full Code Here

    if ((parameters == null) || (parameters.length == 0))
      return;

    for (int i = 0; i < parameters.length; i++)
    {
      Parameter param = parameters[i];
      appendURLParameter(buffer, param.getKey(), param.getValue(context));
    }
  }
View Full Code Here

    // or
    //    'key1':'value1','key2':'value2',
    int length = 0;
    for (int i = 0; i < parameters.length; i++)
    {
      Parameter param = parameters[i];

      String value = param.getValue(context);
      // don't count the length if value is null, since we don't append
      // the parameter if value is null in appendJSParameter
      if (value != null)
      {
        length += value.length();
        length += param.getKey().length();
        // Make sure there is room for the & and the =
        // or the ' : and , chars
        length += 5;
      }
    }
View Full Code Here

          if (kid instanceof UIParameter)
          {
            Object value = ((UIParameter)kid).getValue();
            if (value != null)
            {
              Parameter p = new Parameter();
              p.setKey(((UIParameter)kid).getName());
              p.setValue(value.toString());
              params.add(p);
            }
          }
        }

        if (_part != null)
        {
          Parameter p = new Parameter();
          p.setKey("part");
          p.setValue(_part);
          params.add(p);
        }

        Parameter [] paramArray = params.toArray(_sPARAMS_ARRAY);
        _fireAction.setParameters(paramArray);
View Full Code Here

          if (kid instanceof UIParameter)
          {
            Object value = ((UIParameter)kid).getValue();
            if (value != null)
            {
              Parameter p = new Parameter();
              p.setKey(((UIParameter)kid).getName());
              p.setValue(value.toString());
              params.add(p);
            }
          }
        }

        if (_part != null)
        {
          Parameter p = new Parameter();
          p.setKey("part");
          p.setValue(_part);
          params.add(p);
        }

        Parameter [] paramArray = params.toArray(_sPARAMS_ARRAY);
        _fireAction.setParameters(paramArray);
View Full Code Here

    if (gotParams)
    {
      for (int i = 0; i < parameters.length; i++)
      {
        Parameter param = parameters[i];
        String paramKey = param.getKey();

        // If the ClientAction sets source or event, don't allow a parameter
        // to override it. If it's sent in, it's an attribute and the client
        // should set the value on the clientAction, not in a parameter.
        if (gotEvent && paramKey.equalsIgnoreCase("event"))
          continue;

        if (gotSource && paramKey.equalsIgnoreCase("source"))
          continue;

        // append a comma to separate the fields
        if (!firstParameter)
          buffer.append(',');
        else
          firstParameter = false;

        // Really, we shouldn't need the quotes here at all, unless
        // "paramKey" is invalid.
        buffer.append("'");
        buffer.append(paramKey);
        buffer.append("':'");

        String value = param.getValue(context);
        // BUG 3557710 - FORM ENCODER AND POSTBACK HANDLING
        String encodedValue =
          XhtmlLafUtils.getFormEncodedParameter(formEncoder, formName,
                                                paramKey, value);
        if (encodedValue != null)
View Full Code Here

TOP

Related Classes of org.apache.myfaces.trinidadinternal.ui.collection.Parameter

Copyright © 2018 www.massapicom. 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.