Examples of UIParameter


Examples of javax.faces.component.UIParameter

   protected void doEncodeEnd(ResponseWriter writer, FacesContext context, UIComponent component)
         throws IOException
   {
      UIComponent actionComponent = component.getParent();
      UIComponent form = getUtils().getForm(actionComponent);
      UIParameter parameter = (UIParameter) component;
      if (getUtils().isCommandButton(actionComponent))
      {
         String formId = form.getClientId(context);
         writer.startElement(SCRIPT_ELEM, component);
         writer.writeAttribute(SCRIPT_LANGUAGE_ATTR, SCRIPT_LANGUAGE_JAVASCRIPT, SCRIPT_LANGUAGE_ATTR);
         writer.writeAttribute(SCRIPT_TYPE_ATTR, SCRIPT_TYPE_TEXT_JAVASCRIPT, SCRIPT_TYPE_ATTR);
         if (actionComponent.getId().startsWith(UIViewRoot.UNIQUE_ID_PREFIX))
         {
            getLog().warn("Must set an id for the command buttons with s:conversationPropagation");
         }
        
        
         String functionBody =
            "{" +
               "if (document.getElementById)" +
               "{" +
                  "var form = document.getElementById('" + formId + "');" +
                  "var input = document.createElement('input');" +
                  "if (document.all)" +
                  "{ " + // what follows should work with NN6 but doesn't in M14"
                     "input.type = 'hidden';" +
                     "input.name = '" + getParameterName() + "';" +
                     "input.value = '" + parameter.getValue() + "';" +
                  "}" +
                  "else if (document.getElementById) " +
                  "{" // so here is theNN6 workaround
                     "input.setAttribute('type', 'hidden');" +
                     "input.setAttribute('name', '" + getParameterName() + "');" +
                     "input.setAttribute('value', '" + parameter.getValue() + "');" +
                  "}" +
                  "form.appendChild(input);" +
                  "return true;" +
               "}" +
            "}";
View Full Code Here

Examples of javax.faces.component.UIParameter

        if (command.getChildCount() > 0) {
            ArrayList<Param> parameterList = new ArrayList<Param>();

            for (UIComponent kid : command.getChildren()) {
                if (kid instanceof UIParameter) {
                    UIParameter uiParam = (UIParameter) kid;
                    Object value = uiParam.getValue();
                    Param param = new Param(uiParam.getName(),
                                            (value == null ? null :
                                             value.toString()));
                    parameterList.add(param);
                }
            }
View Full Code Here

Examples of javax.faces.component.UIParameter

        Iterator kids = component.getChildren().iterator();
        while (kids.hasNext()) {
            UIComponent kid = (UIComponent) kids.next();

            if (kid instanceof UIParameter) {
                UIParameter uiParam = (UIParameter) kid;
                String name = uiParam.getName();
                Object value = uiParam.getValue();
                if(null != value){
                  if(haveQestion){
                    uri.append('&');
                  } else {
            uri.append('?');
View Full Code Here

Examples of javax.faces.component.UIParameter

    ajaxFunction.addParameter(options);
    // Fill parameters.
    for (Iterator<UIComponent> it = component.getChildren().iterator(); it.hasNext();) {
      UIComponent child = it.next();
      if (child instanceof UIParameter) {
        UIParameter parameter = ((UIParameter) child);
        String name = parameter.getName();
        func.addParameter(name);
        // Put parameter name to AJAX.Submit parameter, with default value.
        JSReference reference = new JSReference(name);
        if (null != parameter.getValue()) {
          reference = new JSReference(name + "||"
              + ScriptUtils.toScript(parameters.get(name)));

        }
        // Replace parameter value to reference.
View Full Code Here

Examples of javax.faces.component.UIParameter

        UIDatascroller datascroller = (UIDatascroller)component;
        List children = datascroller.getChildren();
        for (Iterator iterator = children.iterator(); iterator.hasNext();) {
        UIComponent child = (UIComponent) iterator.next();
        if(child instanceof UIParameter) {
          UIParameter param = (UIParameter)child;
          String name = param.getName();
          if (name != null) {
            parameters.put(name, param.getValue());
          }
        }
      }
      }
           
View Full Code Here

Examples of javax.faces.component.UIParameter

    public Map<String, Object> getParamsMap(FacesContext context, UIToolTip toolTip) {
        List<UIComponent> children = toolTip.getChildren();
        Map<String, Object> paramsMap = new HashMap<String, Object>();
        for (UIComponent child : children) {
            if (child instanceof UIParameter) {
                UIParameter param = (UIParameter) child;
                paramsMap.put(param.getName(), param.getValue());
            }
        }
        return paramsMap;
    }
View Full Code Here

Examples of javax.faces.component.UIParameter

      for (Iterator iterator = children.iterator(); iterator.hasNext();) {
        UIComponent child = (UIComponent) iterator.next();
 
        if(child instanceof UIParameter){
         
          UIParameter param = (UIParameter)child;
        String name = param.getName();
       
        if (name != null) {
          Object value = param.getValue();
          buff.append("params[");
          buff.append(ScriptUtils.toScript(name));
          buff.append("] = ");
          buff.append(ScriptUtils.toScript(value));
          buff.append(";");
View Full Code Here

Examples of javax.faces.component.UIParameter

  public Object getChildrenParams(FacesContext context, UIComponent component) {
    Map<String, Object> parameters = new HashMap<String, Object>();
    for (Iterator<UIComponent> iterator = component.getChildren().iterator(); iterator.hasNext();) {
      UIComponent child =  iterator.next();
      if (child instanceof UIParameter) {
        UIParameter p = (UIParameter)child;
        parameters.put(p.getName(), p.getValue());
      }
    }
   
    AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
    Map<String, Object> commonAjaxParameters = ajaxContext.getCommonAjaxParameters();
View Full Code Here

Examples of javax.faces.component.UIParameter

      for (Iterator iterator = children.iterator(); iterator.hasNext();) {
        UIComponent child = (UIComponent) iterator.next();
 
        if(child instanceof UIParameter){
         
          UIParameter param = (UIParameter)child;
        String name = param.getName();
       
        if (name != null) {
         
          Object value = param.getValue();
          buff.append("_params[");
          buff.append(ScriptUtils.toScript(name));
          buff.append("] = ");
          buff.append(ScriptUtils.toScript(value));
          buff.append(";");
View Full Code Here

Examples of javax.faces.component.UIParameter

    ResponseWriter writer = context.getResponseWriter();
    List<UIComponent> children = component.getChildren();
    for (UIComponent child : children) {
      if (child instanceof UIParameter) {
        UIParameter parameter = (UIParameter) child;
        StringBuilder b = new StringBuilder();
        b.append("tinyMceParams.");
        ScriptUtils.addEncoded(b, parameter.getName());
        b.append(" = ");
        if (parameter.getValue() != null
            && (parameter.getValue().equals("true") || parameter
                .getValue().equals("false"))) {
          ScriptUtils.addEncoded(b, parameter.getValue());
        } else {
          b.append(ScriptUtils.toScript(parameter.getValue()));
        }
        b.append(";\n");
        writer.writeText(b.toString(), null);
      }
    }
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.