Examples of UIParameter


Examples of javax.faces.component.UIParameter

        UISelectItem item = new UISelectItem();
        item.setValue(new SelectItem("value3", "label3", "description3", true, true, true));
        selectOne.getChildren().add(item);

        // non select item at end
        UIParameter param = new UIParameter();
        param.setName("param");
        param.setValue("paramValue");
        selectOne.getChildren().add(param);

        checkSelectItems(asList(SelectUtils.getSelectItems(facesContext, selectOne)));

        // non select item in middle
View Full Code Here

Examples of javax.faces.component.UIParameter

         List<PathParameter> pathParams = mapping.getPatternParser().getPathParameters();

         int pathParamsFound = 0;
         for (PathParameter p : pathParams)
         {
            UIParameter uip = new UIParameter();
            String[] values = queryParams.get(p.getName());
            if ((values != null) && (values.length > 0))
            {
               String value = values[0];
               uip.setValue(value);
               if ((value != null) && !"".equals(value))
               {
                  pathParamsFound++;
               }
            }
            queryParams.remove(p.getName());
            uiParams.add(uip);
         }

         for (Entry<String, String[]> entry : queryParams.entrySet())
         {
            UIParameter uip = new UIParameter();
            uip.setName(entry.getKey());
            uip.setValue(entry.getValue());
            uiParams.add(uip);
         }

         if (pathParams.size() == pathParamsFound)
         {
View Full Code Here

Examples of javax.faces.component.UIParameter

      List<UIParameter> list = new ArrayList<UIParameter>();
      if(parameters != null)
      {
         for (Entry<String, String[]> e : parameters.entrySet())
         {
            UIParameter p = new UIParameter();
            p.setName(e.getKey());
            p.setValue(e.getValue());
            list.add(p);
         }
      }
      return build(mapping, false, list);
   }
View Full Code Here

Examples of javax.faces.component.UIParameter

      List<UIParameter> list = new ArrayList<UIParameter>();
      if(parameters != null)
      {
         for (Object e : parameters)
         {
            UIParameter p = new UIParameter();
            if (e != null)
            {
               p.setValue(e.toString());
            }
            list.add(p);
         }
      }
      return build(mapping, encodeUrl, list);
View Full Code Here

Examples of javax.faces.component.UIParameter

      List<UIParameter> list = new ArrayList<UIParameter>();
      if(parameters != null)
      {
         for (RequestParameter param : parameters)
         {
            UIParameter p = new UIParameter();
            if (param != null)
            {
               p.setValue(param.getName());
               p.setValue(param.getValue());
            }
            list.add(p);
         }
      }
      return build(mapping, false, list);
View Full Code Here

Examples of javax.faces.component.UIParameter

         if(parameters != null)
         {
            // TODO this logic should be in the components, not in the builder
            if (parameters.size() == 1)
            {
               UIParameter firstParam = parameters.get(0);
               if (((firstParam.getValue() != null)) && (firstParam.getName() == null))
               {
                  if (firstParam.getValue() instanceof List<?>)
                  {
                     URL url = parser.getMappedURL(firstParam.getValue());
                     return url.toURL();
                  }
                  else if (firstParam.getValue().getClass().isArray())
                  {
                     // The Object[] cast here is required, otherwise Java treats
                     // getValue() as a single Object.
                     List<Object> list = Arrays.asList((Object[]) firstParam.getValue());
                     URL url = parser.getMappedURL(list);
                     return url.toURL();
                  }
               }
            }
View Full Code Here

Examples of javax.faces.component.UIParameter

   @Test
   public void testBuildMappedUrlPrettyUrlMappingSingleParameterContainingList()
   {
      List<UIParameter> parameters = new ArrayList<UIParameter>();
      UIParameter param = new UIParameter();
      param.setValue(values);
      parameters.add(param);

      String mappedUrl = builder.build(mapping, false, parameters);
      assertTrue(mappedUrl.startsWith(expectedPath));
   }
View Full Code Here

Examples of javax.faces.component.UIParameter

   @Test
   public void testBuildMappedUrlPrettyUrlMappingSingleParameterContainingArray()
   {
      List<UIParameter> parameters = new ArrayList<UIParameter>();
      UIParameter param = new UIParameter();
      param.setValue(valuesArray);
      parameters.add(param);

      String mappedUrl = builder.build(mapping, false, parameters);
      assertTrue(mappedUrl.startsWith(expectedPath));
   }
View Full Code Here

Examples of javax.faces.component.UIParameter

   @Test(expected = PrettyException.class)
   public void testBuildMappedUrlPrettyUrlMappingSingleNamedParameterDefaultsToNonListBuild()
   {
      List<UIParameter> parameters = new ArrayList<UIParameter>();
      UIParameter param = new UIParameter();
      param.setValue(values);
      param.setName("something");
      parameters.add(param);

      builder.build(mapping, false, parameters);
   }
View Full Code Here

Examples of javax.faces.component.UIParameter

      assertTrue(oldUrl.contains("key2=%D9%84"));

   }
  
   private final static UIParameter createUIParameter(String name, Object value) {
      UIParameter p = new UIParameter();
      p.setName(name);
      p.setValue(value);
      return p;
   }
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.