Package javax.faces.component

Examples of javax.faces.component.UIParameter


    }

    @NotNull
    public static UIParameter addParameter(@NotNull
    UIComponent parent, FacesComponentIdFactory idFactory, String name, String value) {
        UIParameter parameter = createComponent(UIParameter.class, idFactory);
        parameter.setName(name);
        parameter.setValue(value);
        parent.getChildren().add(parameter);
        return parameter;
    }
View Full Code Here


        // Use a LinkedHashMap, so the order of the parameters is maintained.
        Map<String, String> params = new LinkedHashMap<String, String>();
        List<UIComponent> children = component.getChildren();
        for (UIComponent child : children) {
            if (child instanceof UIParameter) {
                UIParameter param = (UIParameter) child;
                Object paramValue = param.getValue();
                params.put(param.getName(), (paramValue != null) ? paramValue.toString() : null);
            }
        }

        return params;
    }
View Full Code Here

                AbstractPropertyBagUIComponentTreeFactory.PANEL_ID_SUFFIX);
            listMemberComponent.setId(newListMemberComponentId);
            String listIndexParamComponentId = PropertyIdGeneratorUtility.getIdentifier(
                propertyList.getList().get(oldIndex), oldIndex,
                AbstractPropertyBagUIComponentTreeFactory.PARAM_ID_SUFFIX);
            UIParameter listIndexParam = (UIParameter) config.findComponent(listIndexParamComponentId);
            String newListIndexParamComponentId = PropertyIdGeneratorUtility.getIdentifier(
                propertyList.getList().get(newIndex), newIndex,
                AbstractPropertyBagUIComponentTreeFactory.PARAM_ID_SUFFIX);
            listIndexParam.setId(newListIndexParamComponentId);
            listIndexParam.setValue(newIndex);
        }
    }
View Full Code Here

            FacesComponentUtility.addParameter(deleteLink, this.config, RequestParameterNameConstants.FUNCTION_PARAM,
                DELETE_LIST_MEMBER_PROPERTY_FUNCTION);
            FacesComponentUtility.addParameter(deleteLink, this.config, RequestParameterNameConstants.LIST_NAME_PARAM,
                listName);
            UIParameter listIndexParam = FacesComponentUtility.addParameter(deleteLink, this.config,
                RequestParameterNameConstants.LIST_INDEX_PARAM, listIndex);
            String paramId = PropertyIdGeneratorUtility.getIdentifier(listMemberProperty, index, PARAM_ID_SUFFIX);
            listIndexParam.setId(paramId);

            FacesComponentUtility.addButton(deleteLink, DELETE_MAP_BUTTON_LABEL, CssStyleClasses.BUTTON_SMALL);
        }

        FacesComponentUtility.addVerbatimText(wrapper, "</td>\n");
View Full Code Here

            // set up the expand control and remove whatever children (if any) this control had previously
            UICommand expandControl = tree.getExpandControl();
            expandControl.setId(context.getViewRoot().createUniqueId());
            expandControl.getChildren().clear();

            UIParameter param = new UIParameter();
            param.setName(tree.getId() + NamingContainer.SEPARATOR_CHAR + NAV_COMMAND);
            param.setValue(tree.getNodeId());
            expandControl.getChildren().add(param);
            expandControl.getChildren().add(image);

            RendererUtils.renderChild(context, expandControl);
        }
View Full Code Here

    HtmlCommandLink link = (HtmlCommandLink) application
            .createComponent(HtmlCommandLink.COMPONENT_TYPE);
    link.setId(scroller.getId() + id);
    link.setTransient(true);
    UIParameter parameter = (UIParameter) application
            .createComponent(UIParameter.COMPONENT_TYPE);
    parameter.setId(scroller.getId() + id + "_param");
    parameter.setTransient(true);
    parameter.setName(scroller.getClientId(facesContext));
    parameter.setValue(id);
    List children = link.getChildren();
    children.add(parameter);
    if (text != null)
    {
      HtmlOutputText uiText = (HtmlOutputText) application
View Full Code Here

    HtmlCommandLink link = (HtmlCommandLink) application
            .createComponent(HtmlCommandLink.COMPONENT_TYPE);
    link.setId(scroller.getId() + facetName);
    link.setTransient(true);
    UIParameter parameter = (UIParameter) application
            .createComponent(UIParameter.COMPONENT_TYPE);
    parameter.setId(scroller.getId() + facetName + "_param");
    parameter.setTransient(true);
    parameter.setName(scroller.getClientId(facesContext));
    parameter.setValue(facetName);
    List children = link.getChildren();
    children.add(parameter);
    scroller.getChildren().add(link);
    return link;
  }
View Full Code Here

        }
        List<UIParameter> validParams = HtmlRendererUtils.getValidUIParameterChildren(
                context, childrenList, false, false);
        for (int j = 0, size = validParams.size(); j < size; j++)
        {
            UIParameter param = validParams.get(j);
            String name = param.getName();

            //Not necessary, since we are using oamSetHiddenInput to create hidden fields
            if (MyfacesConfig.getCurrentInstance(context.getExternalContext()).isRenderHiddenFieldsForLinkParams())
            {
                addHiddenCommandParameter(context, nestingForm, name);
            }

            Object value = param.getValue();

            //UIParameter is no ValueHolder, so no conversion possible - calling .toString on value....
            // MYFACES-1832 bad charset encoding for f:param
            // if HTMLEncoder.encode is called, then
            // when is called on writer.writeAttribute, encode method
View Full Code Here

        List<UIParameter> validParams = HtmlRendererUtils.getValidUIParameterChildren(
                facesContext, childrenList, false, false);
       
        for (int i = 0, size = validParams.size(); i < size; i++)
        {
            UIParameter param = validParams.get(i);
            String name = param.getName();
            Object value = param.getValue();
            addParameterToHref(name, value, hrefBuf, firstParameter, charEncoding, strictXhtmlLinks);
            firstParameter = false;
        }
    }
View Full Code Here

  public static Object findParameter(UIComponent component, String name) {
    for (Object o : component.getChildren()) {
      UIComponent child = (UIComponent) o;
      if (child instanceof UIParameter) {
        UIParameter parameter = (UIParameter) child;
        if (LOG.isDebugEnabled()) {
          LOG.debug("Select name='" + parameter.getName() + "'");
          LOG.debug("Select value='" + parameter.getValue() + "'");
        }
        if (name.equals(parameter.getName())) {
          return parameter.getValue();
        }
      }
    }
    return null;
  }
View Full Code Here

TOP

Related Classes of javax.faces.component.UIParameter

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.