Package javax.faces.component

Examples of javax.faces.component.UIViewParameter


        {
            UIViewRoot root = new UIViewRoot();
            root.setViewId(_viewId);
            UIComponent metadataFacet = new UIPanel();
            root.getFacets().put(UIViewRoot.METADATA_FACET_NAME, metadataFacet);
            UIViewParameter viewparam = new UIViewParameter();
            viewparam.setName("myparam");
            viewparam.setValueExpression("value", new MockValueExpression("#{paramvalue}", String.class));
            metadataFacet.getChildren().add(viewparam);
            return root;
        }
View Full Code Here


         List<UIComponent> children = metadata.getChildren();

         List<PathParameter> pathParameters = prettyContext.getCurrentMapping().getPatternParser().getPathParameters();
         for (PathParameter p : pathParameters)
         {
            UIViewParameter param = (UIViewParameter) context.getApplication().createComponent(
                     UIViewParameter.COMPONENT_TYPE);

            Map<String, Object> requestMap = context.getExternalContext().getRequestMap();
            requestMap.put(p.getName(), p.getValue());
            param.setName(p.getName());

            ValueExpression ve = elUtils.createValueExpression(context, p.getExpression().getELExpression());
            param.setValueExpression("value", ve);
            param.setImmediate(true);
            children.add(param);
         }

         List<QueryParameter> queryParams = prettyContext.getCurrentMapping().getQueryParams();
         for (QueryParameter q : queryParams)
         {
            UIViewParameter param = new UIViewParameter();
            param.setName(q.getName());

            ValueExpression ve = elUtils.createValueExpression(context, q.getExpression().getELExpression());
            param.setValueExpression("value", ve);
            param.setImmediate(true);
            children.add(param);
         }
      }
   }
View Full Code Here

        {
            UIViewRoot root = new UIViewRoot();
            root.setViewId(_viewId);
            UIComponent metadataFacet = new UIPanel();
            root.getFacets().put(UIViewRoot.METADATA_FACET_NAME, metadataFacet);
            UIViewParameter viewparam = new UIViewParameter();
            viewparam.setName("myparam");
            viewparam.setValueExpression("value", new MockValueExpression("#{paramvalue}", String.class));
            metadataFacet.getChildren().add(viewparam);
            return root;
        }
View Full Code Here

        {
            UIViewRoot root = new UIViewRoot();
            root.setViewId(_viewId);
            UIComponent metadataFacet = new UIPanel();
            root.getFacets().put(UIViewRoot.METADATA_FACET_NAME, metadataFacet);
            UIViewParameter viewparam = new UIViewParameter();
            viewparam.setName("myparam");
            viewparam.setValueExpression("value", new MockValueExpression("#{paramvalue}", String.class));
            metadataFacet.getChildren().add(viewparam);
            return root;
        }
View Full Code Here

        {
            UIViewRoot root = new UIViewRoot();
            root.setViewId(_viewId);
            UIComponent metadataFacet = new UIPanel();
            root.getFacets().put(UIViewRoot.METADATA_FACET_NAME, metadataFacet);
            UIViewParameter viewparam = new UIViewParameter();
            viewparam.setName("myparam");
            viewparam.setValueExpression("value", new MockValueExpression("#{paramvalue}", String.class));
            metadataFacet.getChildren().add(viewparam);
            return root;
        }
View Full Code Here

        {
            UIViewRoot root = new UIViewRoot();
            root.setViewId(_viewId);
            UIComponent metadataFacet = new UIPanel();
            root.getFacets().put(UIViewRoot.METADATA_FACET_NAME, metadataFacet);
            UIViewParameter viewparam = new UIViewParameter();
            viewparam.setName("myparam");
            viewparam.setValueExpression("value", new MockValueExpression("#{paramvalue}", String.class));
            metadataFacet.getChildren().add(viewparam);
            return root;
        }
View Full Code Here

        {
            UIViewRoot root = new UIViewRoot();
            root.setViewId(_viewId);
            UIComponent metadataFacet = new UIPanel();
            root.getFacets().put(UIViewRoot.METADATA_FACET_NAME, metadataFacet);
            UIViewParameter viewparam = new UIViewParameter();
            viewparam.setName("myparam");
            viewparam.setValueExpression("value", new MockValueExpression("#{paramvalue}", String.class));
            metadataFacet.getChildren().add(viewparam);
            return root;
        }
View Full Code Here

        ViewMetadata viewMetadata = vdl.getViewMetadata(ctx, viewId);
        UIViewRoot viewRoot = viewMetadata.createMetadataView(ctx);
        UIComponent metadataFacet = viewRoot.getFacet(UIViewRoot.METADATA_FACET_NAME);

        // Looking for a view parameter with the specified name
        UIViewParameter viewParam = null;
        for (UIComponent child : metadataFacet.getChildren()) {
            if (child instanceof UIViewParameter) {
                UIViewParameter tempViewParam = (UIViewParameter) child;
                if (name.equals(tempViewParam.getName())) {
                    viewParam = tempViewParam;
                    break;
                }
            }
        }
View Full Code Here

        if (metadataFacet != null) {
            // Checking each parameter
            for (UIComponent child : metadataFacet.getChildren()) {
                if (child instanceof UIViewParameter) {
                    UIViewParameter viewParameter = (UIViewParameter) child;
                    // Checking if the parameter is required but has an empty value
                    if (viewParameter.getRequiredMessage() != null && isEmpty(viewParameter.getStringValue(ctx))) {
                        // Adding the message
                        FacesMessages messages = BeanInject.lookup(FacesMessages.class);
                        messages.addEL(viewParameter.getRequiredMessage(), FacesMessage.SEVERITY_ERROR);

                        // Redirecting to the error page
                        NavBase nav = BeanInject.lookup(NavBase.class);
                        String url = ctx.getApplication().getViewHandler().getActionURL(ctx, nav.getError().s());
View Full Code Here

                foundOther = true;
            }
        }

        if (foundOther && !foundViewParam) {
            UIViewParameter placeholder = (UIViewParameter) context.getApplication().createComponent(
                    UIViewParameter.COMPONENT_TYPE);
            placeholder.setId(viewRoot.createUniqueId());
            placeholder.setName("");
            metadataFacet.getChildren().add(0, placeholder);
        }

        return viewRoot;
    }
View Full Code Here

TOP

Related Classes of javax.faces.component.UIViewParameter

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.