Examples of HtmlColumn


Examples of org.metawidget.statically.faces.component.html.widgetbuilder.HtmlColumn

      HtmlCommandLink removeLink = new HtmlCommandLink();
      removeLink.putAttribute("styleClass", "remove-button");
      String removeExpression = COLLECTION_VAR + ".remove(" + dataTable.getAttribute("var") + ")";
      removeLink.putAttribute("action", StaticFacesUtils.wrapExpression(removeExpression));

      HtmlColumn column = new HtmlColumn();
      column.putAttribute("headerClass", "remove-column");
      column.putAttribute("footerClass", "remove-column");
      column.getChildren().add(removeLink);
      dataTable.getChildren().add(column);

      // If bidirectional, an 'Add' button too

      String inverseRelationship = attributes.get(INVERSE_RELATIONSHIP);

      if (inverseRelationship != null)
      {
         String componentType = WidgetBuilderUtils.getComponentType(attributes);

         if (componentType != null)
         {
            String controllerName = StringUtils.decapitalize(ClassUtils.getSimpleName(componentType));

            HtmlCommandLink addLink = new HtmlCommandLink();
            addLink.putAttribute("styleClass", "add-button");
            String addExpression = COLLECTION_VAR + ".add(" + controllerName + "Bean.added)";
            addLink.putAttribute("action", StaticFacesUtils.wrapExpression(addExpression));

            // Use a f:setPropertyActionListener to initialize the bidirectional relationship

            SetPropertyActionListener setPropertyActionListener = new SetPropertyActionListener();
            setPropertyActionListener.putAttribute(
                     "target",
                     StaticFacesUtils.wrapExpression(controllerName + "Bean.add." + inverseRelationship));
            StandardBindingProcessor bindingProcessor = metawidget.getWidgetProcessor(StandardBindingProcessor.class);

            if (bindingProcessor != null)
            {
               bindingProcessor.processWidget(setPropertyActionListener, ENTITY, attributes,
                        (StaticUIMetawidget) metawidget);
            }
            addLink.getChildren().add(setPropertyActionListener);

            // (id is useful for unit tests)

            String id = StaticFacesUtils.unwrapExpression(setPropertyActionListener.getValue())
                     + StringUtils.SEPARATOR_DOT_CHAR + attributes.get(NAME) + StringUtils.SEPARATOR_DOT_CHAR + "Add";

            addLink.putAttribute("id", StringUtils.camelCase(id, StringUtils.SEPARATOR_DOT_CHAR));

            Facet footerFacet = new Facet();
            footerFacet.putAttribute("name", "footer");
            footerFacet.getChildren().add(addLink);
            column.getChildren().add(footerFacet);
         }
      }
   }
View Full Code Here

Examples of org.metawidget.statically.faces.component.html.widgetbuilder.HtmlColumn

      }

      // Create the column
      super.addColumnComponent(dataTable, tableAttributes, elementName, columnAttributes, metawidget);
      List<StaticWidget> columns = dataTable.getChildren();
      HtmlColumn column = (HtmlColumn) columns.get(columns.size() - 1);

      // If we can determine the componentType, wrap it with a link

      if (tableAttributes.get(TOP_LEVEL_PARAMETERIZED_TYPE) != null)
      {
         componentType = tableAttributes.get(TOP_LEVEL_PARAMETERIZED_TYPE);
      }

      if (componentType != null)
      {
         String controllerName = StringUtils.decapitalize(ClassUtils.getSimpleName(componentType));

         // Create a link...

         HtmlOutcomeTargetLink link = new HtmlOutcomeTargetLink();
         String outcome = getTargetDir();
         if (!outcome.isEmpty() && !outcome.startsWith("/"))
         {
            outcome = "/" + outcome;
         }
        
         link.putAttribute("outcome", outcome + "/" + controllerName + "/view");

         // ...pointing to the id

         String primaryKeyName = "id";
         String inspectedType = metawidget.inspect(null, componentType);

         if (inspectedType != null)
         {
            Element root = XmlUtils.documentFromString(inspectedType).getDocumentElement();
            NodeList elements = root.getFirstChild().getChildNodes();

            for (int loop = 0, length = elements.getLength(); loop < length; loop++)
            {
               Element element = (Element) elements.item(loop);

               if (element.hasAttribute(PRIMARY_KEY))
               {
                  primaryKeyName = element.getAttribute(NAME);
                  break;
               }
            }
         }

         Param param = new Param();
         param.putAttribute("name", "id");
         param.putAttribute(
                  "value",
                  StaticFacesUtils.wrapExpression(dataTable.getAttribute("var") + StringUtils.SEPARATOR_DOT_CHAR
                           + primaryKeyName));
         link.getChildren().add(param);
         link.getChildren().add(column.getChildren().remove(1));
         if (columnAttributes.containsKey(FACES_LOOKUP) && columnAttributes.containsKey(REVERSE_PRIMARY_KEY))
         {
            StaticHtmlMetawidget output = (StaticHtmlMetawidget) link.getChildren().get(1);
            String displayExpression = "forgeview:display(" + dataTable.getAttribute("var")
                     + StringUtils.SEPARATOR_DOT_CHAR
                     + StringUtils.decapitalize(columnAttributes.get(NAME)) + ")";
            ((BaseStaticXmlWidget) link).putAdditionalNamespaceURI("forgeview", "http://jboss.org/forge/view");
            output.setValue(StaticFacesUtils.wrapExpression(displayExpression));
         }
         if (tableAttributes.get(PARAMETERIZED_TYPE_PATH) != null)
         {
            // Recreate the EL expression. This is done to ensure that correctly nested EL expressions are created for
            // expanded entities. The originally created expression in super.addColumnComponent is incorrect for
            // expanded entities since it assumes that all referenced names are at the same level
            String valueExpression = dataTable.getAttribute("var") + StringUtils.SEPARATOR_DOT_CHAR
                     + tableAttributes.get(PARAMETERIZED_TYPE_PATH) + StringUtils.SEPARATOR_DOT_CHAR
                     + StringUtils.decapitalize(columnAttributes.get(NAME));

            StaticHtmlMetawidget output = (StaticHtmlMetawidget) link.getChildren().get(1);
            output.setValue(StaticFacesUtils.wrapExpression(valueExpression));
         }
         column.getChildren().add(link);

         // If bidirectional, add a footer facet

         if (tableAttributes.containsKey(INVERSE_RELATIONSHIP) && !metawidget.isReadOnly())
         {
            // If it's an inverse relationship, we really should have been able to determine sub-properties, so we
            // should never be at 'entity' level *unless* componentType couldn't resolve to an actual type

            if (!ENTITY.equals(elementName))
            {
               StaticHtmlMetawidget footerMetawidget = new StaticHtmlMetawidget();
               Map<String, String> footerAttributes = CollectionUtils.newHashMap();
               metawidget.initNestedMetawidget(footerMetawidget, footerAttributes);

               // (footer facets should never have a 'required' attribute)

               footerMetawidget.removeWidgetProcessor(footerMetawidget
                        .getWidgetProcessor(RequiredAttributeProcessor.class));
               footerMetawidget.setValue(StaticFacesUtils.wrapExpression(controllerName + "Bean.add." + columnName));
               footerMetawidget.setPath(componentType + StringUtils.SEPARATOR_FORWARD_SLASH_CHAR + columnName);
               footerMetawidget.setLayout(new SimpleLayout());

               Facet footerFacet = new Facet();
               footerFacet.putAttribute("name", "footer");
               footerFacet.getChildren().add(footerMetawidget);

               ReadableIdProcessor readableIdProcessor = metawidget.getWidgetProcessor(ReadableIdProcessor.class);

               if (readableIdProcessor != null)
               {
                  readableIdProcessor.processWidget(footerMetawidget, elementName, columnAttributes, metawidget);
               }

               HtmlMessage message = new HtmlMessage();
               message.putAttribute("for", footerMetawidget.getAttribute("id"));
               message.putAttribute("styleClass", "error");
               footerFacet.getChildren().add(message);
               column.getChildren().add(footerFacet);
            }
         }
      }
   }
View Full Code Here

Examples of org.metawidget.statically.faces.component.html.widgetbuilder.HtmlColumn

      HtmlCommandLink removeLink = new HtmlCommandLink();
      removeLink.putAttribute("styleClass", "remove-button");
      String removeExpression = COLLECTION_VAR + ".remove(" + dataTable.getAttribute("var") + ")";
      removeLink.putAttribute("action", StaticFacesUtils.wrapExpression(removeExpression));

      HtmlColumn column = new HtmlColumn();
      column.putAttribute("headerClass", "remove-column");
      column.putAttribute("footerClass", "remove-column");
      column.getChildren().add(removeLink);
      dataTable.getChildren().add(column);

      // If bidirectional, an 'Add' button too

      String inverseRelationship = attributes.get(INVERSE_RELATIONSHIP);

      if (inverseRelationship != null)
      {
         String componentType = WidgetBuilderUtils.getComponentType(attributes);

         if (componentType != null)
         {
            String controllerName = StringUtils.decapitalize(ClassUtils.getSimpleName(componentType));

            HtmlCommandLink addLink = new HtmlCommandLink();
            addLink.putAttribute("styleClass", "add-button");
            String addExpression = COLLECTION_VAR + ".add(" + controllerName + "Bean.added)";
            addLink.putAttribute("action", StaticFacesUtils.wrapExpression(addExpression));

            // Use a f:setPropertyActionListener to initialize the bidirectional relationship

            SetPropertyActionListener setPropertyActionListener = new SetPropertyActionListener();
            setPropertyActionListener.putAttribute(
                     "target",
                     StaticFacesUtils.wrapExpression(controllerName + "Bean.add." + inverseRelationship));
            StandardBindingProcessor bindingProcessor = metawidget.getWidgetProcessor(StandardBindingProcessor.class);

            if (bindingProcessor != null)
            {
               bindingProcessor.processWidget(setPropertyActionListener, ENTITY, attributes,
                        (StaticUIMetawidget) metawidget);
            }
            addLink.getChildren().add(setPropertyActionListener);

            // (id is useful for unit tests)

            String id = StaticFacesUtils.unwrapExpression(setPropertyActionListener.getValue())
                     + StringUtils.SEPARATOR_DOT_CHAR + attributes.get(NAME) + StringUtils.SEPARATOR_DOT_CHAR + "Add";

            addLink.putAttribute("id", StringUtils.camelCase(id, StringUtils.SEPARATOR_DOT_CHAR));

            Facet footerFacet = new Facet();
            footerFacet.putAttribute("name", "footer");
            footerFacet.getChildren().add(addLink);
            column.getChildren().add(footerFacet);
         }
      }
   }
View Full Code Here

Examples of org.metawidget.statically.faces.component.html.widgetbuilder.HtmlColumn

      }

      // Create the column
      super.addColumnComponent(dataTable, tableAttributes, elementName, columnAttributes, metawidget);
      List<StaticWidget> columns = dataTable.getChildren();
      HtmlColumn column = (HtmlColumn) columns.get(columns.size() - 1);

      // If we can determine the componentType, wrap it with a link

      if (tableAttributes.get(TOP_LEVEL_PARAMETERIZED_TYPE) != null)
      {
         componentType = tableAttributes.get(TOP_LEVEL_PARAMETERIZED_TYPE);
      }

      if (componentType != null)
      {
         String controllerName = StringUtils.decapitalize(ClassUtils.getSimpleName(componentType));

         // Create a link...

         HtmlOutcomeTargetLink link = new HtmlOutcomeTargetLink();
         link.putAttribute("outcome", getTargetDir() + "/" + controllerName + "/view");

         // ...pointing to the id

         String primaryKeyName = "id";
         String inspectedType = metawidget.inspect(null, componentType);

         if (inspectedType != null)
         {
            Element root = XmlUtils.documentFromString(inspectedType).getDocumentElement();
            NodeList elements = root.getFirstChild().getChildNodes();

            for (int loop = 0, length = elements.getLength(); loop < length; loop++)
            {
               Element element = (Element) elements.item(loop);

               if (element.hasAttribute(PRIMARY_KEY))
               {
                  primaryKeyName = element.getAttribute(NAME);
                  break;
               }
            }
         }

         Param param = new Param();
         param.putAttribute("name", "id");
         param.putAttribute(
                  "value",
                  StaticFacesUtils.wrapExpression(dataTable.getAttribute("var") + StringUtils.SEPARATOR_DOT_CHAR
                           + primaryKeyName));
         link.getChildren().add(param);
         link.getChildren().add(column.getChildren().remove(1));
         if(columnAttributes.containsKey(FACES_LOOKUP) && columnAttributes.containsKey(REVERSE_PRIMARY_KEY))
         {
            StaticHtmlMetawidget output = (StaticHtmlMetawidget) link.getChildren().get(1);
            String displayExpression = "forgeview:display(" + dataTable.getAttribute("var")
                     + StringUtils.SEPARATOR_DOT_CHAR
                     + StringUtils.decapitalize(columnAttributes.get(NAME)) + ")";
            ((BaseStaticXmlWidget) link).putAdditionalNamespaceURI("forgeview", "http://jboss.org/forge/view");
            output.setValue(StaticFacesUtils.wrapExpression(displayExpression));
         }
         if (tableAttributes.get(PARAMETERIZED_TYPE_PATH) != null)
         {
            // Recreate the EL expression. This is done to ensure that correctly nested EL expressions are created for
            // expanded entities. The originally created expression in super.addColumnComponent is incorrect for
            // expanded entities since it assumes that all referenced names are at the same level
            String valueExpression = dataTable.getAttribute("var") + StringUtils.SEPARATOR_DOT_CHAR
                     + tableAttributes.get(PARAMETERIZED_TYPE_PATH) + StringUtils.SEPARATOR_DOT_CHAR
                     + StringUtils.decapitalize(columnAttributes.get(NAME));
           
            StaticHtmlMetawidget output = (StaticHtmlMetawidget) link.getChildren().get(1);
            output.setValue(StaticFacesUtils.wrapExpression(valueExpression));
         }
         column.getChildren().add(link);

         // If bidirectional, add a footer facet

         if (tableAttributes.containsKey(INVERSE_RELATIONSHIP) && !metawidget.isReadOnly())
         {
            // If it's an inverse relationship, we really should have been able to determine sub-properties, so we
            // should never be at 'entity' level *unless* componentType couldn't resolve to an actual type

            if (!ENTITY.equals(elementName))
            {
               StaticHtmlMetawidget footerMetawidget = new StaticHtmlMetawidget();
               Map<String, String> footerAttributes = CollectionUtils.newHashMap();
               metawidget.initNestedMetawidget(footerMetawidget, footerAttributes);

               // (footer facets should never have a 'required' attribute)

               footerMetawidget.removeWidgetProcessor(footerMetawidget
                        .getWidgetProcessor(RequiredAttributeProcessor.class));
               footerMetawidget.setValue(StaticFacesUtils.wrapExpression(controllerName + "Bean.add." + columnName));
               footerMetawidget.setPath(componentType + StringUtils.SEPARATOR_FORWARD_SLASH_CHAR + columnName);
               footerMetawidget.setLayout(new SimpleLayout());

               Facet footerFacet = new Facet();
               footerFacet.putAttribute("name", "footer");
               footerFacet.getChildren().add(footerMetawidget);

               ReadableIdProcessor readableIdProcessor = metawidget.getWidgetProcessor(ReadableIdProcessor.class);

               if (readableIdProcessor != null)
               {
                  readableIdProcessor.processWidget(footerMetawidget, elementName, columnAttributes, metawidget);
               }

               HtmlMessage message = new HtmlMessage();
               message.putAttribute("for", footerMetawidget.getAttribute("id"));
               message.putAttribute("styleClass", "error");
               footerFacet.getChildren().add(message);
               column.getChildren().add(footerFacet);
            }
         }
      }
   }
View Full Code Here

Examples of org.metawidget.statically.faces.component.html.widgetbuilder.HtmlColumn

      HtmlCommandLink removeLink = new HtmlCommandLink();
      removeLink.putAttribute("styleClass", "remove-button");
      String removeExpression = COLLECTION_VAR + ".remove(" + dataTable.getAttribute("var") + ")";
      removeLink.putAttribute("action", StaticFacesUtils.wrapExpression(removeExpression));

      HtmlColumn column = new HtmlColumn();
      column.putAttribute("headerClass", "remove-column");
      column.putAttribute("footerClass", "remove-column");
      column.getChildren().add(removeLink);
      dataTable.getChildren().add(column);

      // If bidirectional, an 'Add' button too

      String inverseRelationship = attributes.get(INVERSE_RELATIONSHIP);

      if (inverseRelationship != null)
      {
         String componentType = WidgetBuilderUtils.getComponentType(attributes);

         if (componentType != null)
         {
            String controllerName = StringUtils.decapitalize(ClassUtils.getSimpleName(componentType));

            HtmlCommandLink addLink = new HtmlCommandLink();
            addLink.putAttribute("styleClass", "add-button");
            String addExpression = COLLECTION_VAR + ".add(" + controllerName + "Bean.added)";
            addLink.putAttribute("action", StaticFacesUtils.wrapExpression(addExpression));

            // Use a f:setPropertyActionListener to initialize the bidirectional relationship

            SetPropertyActionListener setPropertyActionListener = new SetPropertyActionListener();
            setPropertyActionListener.putAttribute(
                     "target",
                     StaticFacesUtils.wrapExpression(controllerName + "Bean.add." + inverseRelationship));
            StandardBindingProcessor bindingProcessor = metawidget.getWidgetProcessor(StandardBindingProcessor.class);

            if (bindingProcessor != null)
            {
               bindingProcessor.processWidget(setPropertyActionListener, ENTITY, attributes,
                        (StaticUIMetawidget) metawidget);
            }
            addLink.getChildren().add(setPropertyActionListener);

            // (id is useful for unit tests)

            String id = StaticFacesUtils.unwrapExpression(setPropertyActionListener.getValue())
                     + StringUtils.SEPARATOR_DOT_CHAR + attributes.get(NAME) + StringUtils.SEPARATOR_DOT_CHAR + "Add";

            addLink.putAttribute("id", StringUtils.camelCase(id, StringUtils.SEPARATOR_DOT_CHAR));

            Facet footerFacet = new Facet();
            footerFacet.putAttribute("name", "footer");
            footerFacet.getChildren().add(addLink);
            column.getChildren().add(footerFacet);
         }
      }
   }
View Full Code Here

Examples of org.metawidget.statically.faces.component.html.widgetbuilder.HtmlColumn

      // Create the column

      super.addColumnComponent(dataTable, tableAttributes, elementName, columnAttributes, metawidget);
      List<StaticWidget> columns = dataTable.getChildren();
      HtmlColumn column = (HtmlColumn) columns.get(columns.size() - 1);

      // If we can determine the componentType, wrap it with a link

      if (tableAttributes.get(TOP_LEVEL_PARAMETERIZED_TYPE) != null)
      {
         componentType = tableAttributes.get(TOP_LEVEL_PARAMETERIZED_TYPE);
      }

      if (componentType != null)
      {
         String controllerName = StringUtils.decapitalize(ClassUtils.getSimpleName(componentType));

         // Create a link...

         HtmlOutcomeTargetLink link = new HtmlOutcomeTargetLink();
         link.putAttribute("outcome", "/scaffold/" + controllerName + "/view");

         // ...pointing to the id

         Param param = new Param();
         param.putAttribute("name", "id");
         param.putAttribute("value", StaticFacesUtils.wrapExpression(dataTable.getAttribute("var") + ".id"));
         link.getChildren().add(param);
         link.getChildren().add(column.getChildren().remove(1));
         column.getChildren().add(link);

         // If bidirectional, add a footer facet

         if (tableAttributes.containsKey(INVERSE_RELATIONSHIP) && !metawidget.isReadOnly())
         {
            // If it's an inverse relationship, we really should have been able to determine sub-properties, so we
            // should never be at 'entity' level *unless* componentType couldn't resolve to an actual type

            if (!ENTITY.equals(elementName))
            {
               StaticHtmlMetawidget footerMetawidget = new StaticHtmlMetawidget();
               Map<String, String> footerAttributes = CollectionUtils.newHashMap();
               metawidget.initNestedMetawidget(footerMetawidget, footerAttributes);
               footerMetawidget.setValue(StaticFacesUtils.wrapExpression(controllerName + "Bean.add." + columnName));
               footerMetawidget.setPath(componentType + StringUtils.SEPARATOR_FORWARD_SLASH_CHAR + columnName);
               footerMetawidget.setLayout(new SimpleLayout());

               Facet footerFacet = new Facet();
               footerFacet.putAttribute("name", "footer");
               footerFacet.getChildren().add(footerMetawidget);
               column.getChildren().add(footerFacet);
            }
         }
      }
   }
View Full Code Here

Examples of org.metawidget.statically.faces.component.html.widgetbuilder.HtmlColumn

      HtmlCommandLink removeLink = new HtmlCommandLink();
      removeLink.putAttribute("styleClass", "remove-button");
      String removeExpression = COLLECTION_VAR + ".remove(" + dataTable.getAttribute("var") + ")";
      removeLink.putAttribute("action", StaticFacesUtils.wrapExpression(removeExpression));

      HtmlColumn column = new HtmlColumn();
      column.putAttribute("headerClass", "remove-column");
      column.putAttribute("footerClass", "remove-column");
      column.getChildren().add(removeLink);
      dataTable.getChildren().add(column);

      // If bidirectional, an 'Add' button too

      String inverseRelationship = attributes.get(INVERSE_RELATIONSHIP);

      if (inverseRelationship != null)
      {
         String componentType = WidgetBuilderUtils.getComponentType(attributes);

         if (componentType != null)
         {
            String controllerName = StringUtils.decapitalize(ClassUtils.getSimpleName(componentType));

            HtmlCommandLink addLink = new HtmlCommandLink();
            addLink.putAttribute("styleClass", "add-button");
            String addExpression = COLLECTION_VAR + ".add(" + controllerName + "Bean.added)";
            addLink.putAttribute("action", StaticFacesUtils.wrapExpression(addExpression));

            // Use a f:setPropertyActionListener to initialize the bidirectional relationship

            SetPropertyActionListener setPropertyActionListener = new SetPropertyActionListener();
            setPropertyActionListener.putAttribute(
                     "target",
                     StaticFacesUtils.wrapExpression(controllerName + "Bean.add." + inverseRelationship));
            StandardBindingProcessor bindingProcessor = metawidget.getWidgetProcessor(StandardBindingProcessor.class);

            if (bindingProcessor != null)
            {
               bindingProcessor.processWidget(setPropertyActionListener, ENTITY, attributes,
                        (StaticUIMetawidget) metawidget);
            }
            addLink.getChildren().add(setPropertyActionListener);

            // (id is useful for unit tests)

            String id = StaticFacesUtils.unwrapExpression(setPropertyActionListener.getValue())
                     + StringUtils.SEPARATOR_DOT_CHAR + attributes.get(NAME) + StringUtils.SEPARATOR_DOT_CHAR + "Add";

            addLink.putAttribute("id", StringUtils.camelCase(id, StringUtils.SEPARATOR_DOT_CHAR));

            Facet footerFacet = new Facet();
            footerFacet.putAttribute("name", "footer");
            footerFacet.getChildren().add(addLink);
            column.getChildren().add(footerFacet);
         }
      }
   }
View Full Code Here

Examples of org.metawidget.statically.faces.component.html.widgetbuilder.HtmlColumn

      }

      // Create the column
      super.addColumnComponent(dataTable, tableAttributes, elementName, columnAttributes, metawidget);
      List<StaticWidget> columns = dataTable.getChildren();
      HtmlColumn column = (HtmlColumn) columns.get(columns.size() - 1);

      // If we can determine the componentType, wrap it with a link

      if (tableAttributes.get(TOP_LEVEL_PARAMETERIZED_TYPE) != null)
      {
         componentType = tableAttributes.get(TOP_LEVEL_PARAMETERIZED_TYPE);
      }

      if (componentType != null)
      {
         String controllerName = StringUtils.decapitalize(ClassUtils.getSimpleName(componentType));

         // Create a link...

         HtmlOutcomeTargetLink link = new HtmlOutcomeTargetLink();
         link.putAttribute("outcome", getTargetDir() + "/" + controllerName + "/view");

         // ...pointing to the id

         String primaryKeyName = "id";
         String inspectedType = metawidget.inspect(null, componentType);

         if (inspectedType != null)
         {
            Element root = XmlUtils.documentFromString(inspectedType).getDocumentElement();
            NodeList elements = root.getFirstChild().getChildNodes();

            for (int loop = 0, length = elements.getLength(); loop < length; loop++)
            {
               Element element = (Element) elements.item(loop);

               if (element.hasAttribute(PRIMARY_KEY))
               {
                  primaryKeyName = element.getAttribute(NAME);
                  break;
               }
            }
         }

         Param param = new Param();
         param.putAttribute("name", "id");
         param.putAttribute(
                  "value",
                  StaticFacesUtils.wrapExpression(dataTable.getAttribute("var") + StringUtils.SEPARATOR_DOT_CHAR
                           + primaryKeyName));
         link.getChildren().add(param);
         link.getChildren().add(column.getChildren().remove(1));
         if(columnAttributes.containsKey(FACES_LOOKUP) && columnAttributes.containsKey(REVERSE_PRIMARY_KEY))
         {
            StaticHtmlMetawidget output = (StaticHtmlMetawidget) link.getChildren().get(1);
            String displayExpression = "forgeview:display(" + dataTable.getAttribute("var")
                     + StringUtils.SEPARATOR_DOT_CHAR
                     + StringUtils.decapitalize(columnAttributes.get(NAME)) + ")";
            ((BaseStaticXmlWidget) link).putAdditionalNamespaceURI("forgeview", "http://jboss.org/forge/view");
            output.setValue(StaticFacesUtils.wrapExpression(displayExpression));
         }
         if (tableAttributes.get(PARAMETERIZED_TYPE_PATH) != null)
         {
            // Recreate the EL expression. This is done to ensure that correctly nested EL expressions are created for
            // expanded entities. The originally created expression in super.addColumnComponent is incorrect for
            // expanded entities since it assumes that all referenced names are at the same level
            String valueExpression = dataTable.getAttribute("var") + StringUtils.SEPARATOR_DOT_CHAR
                     + tableAttributes.get(PARAMETERIZED_TYPE_PATH) + StringUtils.SEPARATOR_DOT_CHAR
                     + StringUtils.decapitalize(columnAttributes.get(NAME));
           
            StaticHtmlMetawidget output = (StaticHtmlMetawidget) link.getChildren().get(1);
            output.setValue(StaticFacesUtils.wrapExpression(valueExpression));
         }
         column.getChildren().add(link);

         // If bidirectional, add a footer facet

         if (tableAttributes.containsKey(INVERSE_RELATIONSHIP) && !metawidget.isReadOnly())
         {
            // If it's an inverse relationship, we really should have been able to determine sub-properties, so we
            // should never be at 'entity' level *unless* componentType couldn't resolve to an actual type

            if (!ENTITY.equals(elementName))
            {
               StaticHtmlMetawidget footerMetawidget = new StaticHtmlMetawidget();
               Map<String, String> footerAttributes = CollectionUtils.newHashMap();
               metawidget.initNestedMetawidget(footerMetawidget, footerAttributes);

               // (footer facets should never have a 'required' attribute)

               footerMetawidget.removeWidgetProcessor(footerMetawidget
                        .getWidgetProcessor(RequiredAttributeProcessor.class));
               footerMetawidget.setValue(StaticFacesUtils.wrapExpression(controllerName + "Bean.add." + columnName));
               footerMetawidget.setPath(componentType + StringUtils.SEPARATOR_FORWARD_SLASH_CHAR + columnName);
               footerMetawidget.setLayout(new SimpleLayout());

               Facet footerFacet = new Facet();
               footerFacet.putAttribute("name", "footer");
               footerFacet.getChildren().add(footerMetawidget);

               ReadableIdProcessor readableIdProcessor = metawidget.getWidgetProcessor(ReadableIdProcessor.class);

               if (readableIdProcessor != null)
               {
                  readableIdProcessor.processWidget(footerMetawidget, elementName, columnAttributes, metawidget);
               }

               HtmlMessage message = new HtmlMessage();
               message.putAttribute("for", footerMetawidget.getAttribute("id"));
               message.putAttribute("styleClass", "error");
               footerFacet.getChildren().add(message);
               column.getChildren().add(footerFacet);
            }
         }
      }
   }
View Full Code Here

Examples of org.richfaces.component.html.HtmlColumn

     */
    protected void setProperties(UIComponent component)
    {
        // TODO Auto-generated method stub
        super.setProperties(component);
    HtmlColumn comp = (HtmlColumn) component;
             
            if (this._breakBefore != null) {
        if (this._breakBefore.isLiteralText()) {
          try {
                       
            Boolean __breakBefore = (Boolean) getFacesContext().
              getApplication().
                getExpressionFactory().
                  coerceToType(this._breakBefore.getExpressionString(),
                      Boolean.class);
         
                        comp.setBreakBefore(__breakBefore.booleanValue());
                      } catch (ELException e) {
            throw new FacesException(e);
          }
        } else {
          component.setValueExpression("breakBefore", this._breakBefore);
        }
      }
                        
            if (this._colspan != null) {
        if (this._colspan.isLiteralText()) {
          try {
                       
            Integer __colspan = (Integer) getFacesContext().
              getApplication().
                getExpressionFactory().
                  coerceToType(this._colspan.getExpressionString(),
                      Integer.class);
         
                        comp.setColspan(__colspan.intValue());
                      } catch (ELException e) {
            throw new FacesException(e);
          }
        } else {
          component.setValueExpression("colspan", this._colspan);
        }
      }
                        
            if (this._comparator != null) {
        if (this._comparator.isLiteralText()) {
          try {
                       
            java.util.Comparator __comparator = (java.util.Comparator) getFacesContext().
              getApplication().
                getExpressionFactory().
                  coerceToType(this._comparator.getExpressionString(),
                      java.util.Comparator.class);
         
                        comp.setComparator(__comparator);
                      } catch (ELException e) {
            throw new FacesException(e);
          }
        } else {
          component.setValueExpression("comparator", this._comparator);
        }
      }
                                   if(null != this._filterBy && this._filterBy.isLiteralText()){
          throw new IllegalArgumentException("Component org.richfaces.Column with Id " + component.getClientId(getFacesContext()) +" allows only EL expressions for property filterBy");
        }
      
            if (this._filterBy != null) {
        if (this._filterBy.isLiteralText()) {
          try {
                       
            java.lang.Object __filterBy = (java.lang.Object) getFacesContext().
              getApplication().
                getExpressionFactory().
                  coerceToType(this._filterBy.getExpressionString(),
                      java.lang.Object.class);
         
                        comp.setFilterBy(__filterBy);
                      } catch (ELException e) {
            throw new FacesException(e);
          }
        } else {
          component.setValueExpression("filterBy", this._filterBy);
        }
      }
                        
            if (this._filterEvent != null) {
        if (this._filterEvent.isLiteralText()) {
          try {
                       
            java.lang.String __filterEvent = (java.lang.String) getFacesContext().
              getApplication().
                getExpressionFactory().
                  coerceToType(this._filterEvent.getExpressionString(),
                      java.lang.String.class);
         
                        comp.setFilterEvent(__filterEvent);
                      } catch (ELException e) {
            throw new FacesException(e);
          }
        } else {
          component.setValueExpression("filterEvent", this._filterEvent);
        }
      }
                                 if(null != this._filterExpression && this._filterExpression.isLiteralText()){
          throw new IllegalArgumentException("Component org.richfaces.Column with Id " + component.getClientId(getFacesContext()) +" allows only EL expressions for property filterExpression");
        }
      
            if (this._filterExpression != null) {
        if (this._filterExpression.isLiteralText()) {
          try {
                       
            Boolean __filterExpression = (Boolean) getFacesContext().
              getApplication().
                getExpressionFactory().
                  coerceToType(this._filterExpression.getExpressionString(),
                      Boolean.class);
         
                        comp.setFilterExpression(__filterExpression.booleanValue());
                      } catch (ELException e) {
            throw new FacesException(e);
          }
        } else {
          component.setValueExpression("filterExpression", this._filterExpression);
        }
      }
                         if(null != this._filterMethod){
        ((HtmlColumn)component).setFilterMethod(this._filterMethod);
      }   
                  
            if (this._filterValue != null) {
        if (this._filterValue.isLiteralText()) {
          try {
                       
            java.lang.String __filterValue = (java.lang.String) getFacesContext().
              getApplication().
                getExpressionFactory().
                  coerceToType(this._filterValue.getExpressionString(),
                      java.lang.String.class);
         
                        comp.setFilterValue(__filterValue);
                      } catch (ELException e) {
            throw new FacesException(e);
          }
        } else {
          component.setValueExpression("filterValue", this._filterValue);
        }
      }
                         
            if (this._footerClass != null) {
        if (this._footerClass.isLiteralText()) {
          try {
                       
            java.lang.String __footerClass = (java.lang.String) getFacesContext().
              getApplication().
                getExpressionFactory().
                  coerceToType(this._footerClass.getExpressionString(),
                      java.lang.String.class);
         
                        comp.setFooterClass(__footerClass);
                      } catch (ELException e) {
            throw new FacesException(e);
          }
        } else {
          component.setValueExpression("footerClass", this._footerClass);
        }
      }
                         
            if (this._headerClass != null) {
        if (this._headerClass.isLiteralText()) {
          try {
                       
            java.lang.String __headerClass = (java.lang.String) getFacesContext().
              getApplication().
                getExpressionFactory().
                  coerceToType(this._headerClass.getExpressionString(),
                      java.lang.String.class);
         
                        comp.setHeaderClass(__headerClass);
                      } catch (ELException e) {
            throw new FacesException(e);
          }
        } else {
          component.setValueExpression("headerClass", this._headerClass);
        }
      }
                         
            if (this._label != null) {
        if (this._label.isLiteralText()) {
          try {
                       
            java.lang.String __label = (java.lang.String) getFacesContext().
              getApplication().
                getExpressionFactory().
                  coerceToType(this._label.getExpressionString(),
                      java.lang.String.class);
         
                        comp.setLabel(__label);
                      } catch (ELException e) {
            throw new FacesException(e);
          }
        } else {
          component.setValueExpression("label", this._label);
        }
      }
                          
            if (this._rowspan != null) {
        if (this._rowspan.isLiteralText()) {
          try {
                       
            Integer __rowspan = (Integer) getFacesContext().
              getApplication().
                getExpressionFactory().
                  coerceToType(this._rowspan.getExpressionString(),
                      Integer.class);
         
                        comp.setRowspan(__rowspan.intValue());
                      } catch (ELException e) {
            throw new FacesException(e);
          }
        } else {
          component.setValueExpression("rowspan", this._rowspan);
        }
      }
                        
            if (this._selfSorted != null) {
        if (this._selfSorted.isLiteralText()) {
          try {
                       
            Boolean __selfSorted = (Boolean) getFacesContext().
              getApplication().
                getExpressionFactory().
                  coerceToType(this._selfSorted.getExpressionString(),
                      Boolean.class);
         
                        comp.setSelfSorted(__selfSorted.booleanValue());
                      } catch (ELException e) {
            throw new FacesException(e);
          }
        } else {
          component.setValueExpression("selfSorted", this._selfSorted);
        }
      }
                        
            if (this._sortBy != null) {
        if (this._sortBy.isLiteralText()) {
          try {
                       
            java.lang.Object __sortBy = (java.lang.Object) getFacesContext().
              getApplication().
                getExpressionFactory().
                  coerceToType(this._sortBy.getExpressionString(),
                      java.lang.Object.class);
         
                        comp.setSortBy(__sortBy);
                      } catch (ELException e) {
            throw new FacesException(e);
          }
        } else {
          component.setValueExpression("sortBy", this._sortBy);
        }
      }
                        
            if (this._sortExpression != null) {
        if (this._sortExpression.isLiteralText()) {
          try {
                       
            java.lang.String __sortExpression = (java.lang.String) getFacesContext().
              getApplication().
                getExpressionFactory().
                  coerceToType(this._sortExpression.getExpressionString(),
                      java.lang.String.class);
         
                        comp.setSortExpression(__sortExpression);
                      } catch (ELException e) {
            throw new FacesException(e);
          }
        } else {
          component.setValueExpression("sortExpression", this._sortExpression);
        }
      }
                         
            if (this._sortIcon != null) {
        if (this._sortIcon.isLiteralText()) {
          try {
                       
            java.lang.String __sortIcon = (java.lang.String) getFacesContext().
              getApplication().
                getExpressionFactory().
                  coerceToType(this._sortIcon.getExpressionString(),
                      java.lang.String.class);
         
                        comp.setSortIcon(__sortIcon);
                      } catch (ELException e) {
            throw new FacesException(e);
          }
        } else {
          component.setValueExpression("sortIcon", this._sortIcon);
        }
      }
                        
            if (this._sortIconAscending != null) {
        if (this._sortIconAscending.isLiteralText()) {
          try {
                       
            java.lang.String __sortIconAscending = (java.lang.String) getFacesContext().
              getApplication().
                getExpressionFactory().
                  coerceToType(this._sortIconAscending.getExpressionString(),
                      java.lang.String.class);
         
                        comp.setSortIconAscending(__sortIconAscending);
                      } catch (ELException e) {
            throw new FacesException(e);
          }
        } else {
          component.setValueExpression("sortIconAscending", this._sortIconAscending);
        }
      }
                        
            if (this._sortIconDescending != null) {
        if (this._sortIconDescending.isLiteralText()) {
          try {
                       
            java.lang.String __sortIconDescending = (java.lang.String) getFacesContext().
              getApplication().
                getExpressionFactory().
                  coerceToType(this._sortIconDescending.getExpressionString(),
                      java.lang.String.class);
         
                        comp.setSortIconDescending(__sortIconDescending);
                      } catch (ELException e) {
            throw new FacesException(e);
          }
        } else {
          component.setValueExpression("sortIconDescending", this._sortIconDescending);
        }
      }
                        
            if (this._sortOrder != null) {
        if (this._sortOrder.isLiteralText()) {
          try {
                       
            org.richfaces.model.Ordering __sortOrder = (org.richfaces.model.Ordering) getFacesContext().
              getApplication().
                getExpressionFactory().
                  coerceToType(this._sortOrder.getExpressionString(),
                      org.richfaces.model.Ordering.class);
         
                        comp.setSortOrder(__sortOrder);
                      } catch (ELException e) {
            throw new FacesException(e);
          }
        } else {
          component.setValueExpression("sortOrder", this._sortOrder);
        }
      }
                        
            if (this._sortable != null) {
        if (this._sortable.isLiteralText()) {
          try {
                       
            Boolean __sortable = (Boolean) getFacesContext().
              getApplication().
                getExpressionFactory().
                  coerceToType(this._sortable.getExpressionString(),
                      Boolean.class);
         
                        comp.setSortable(__sortable.booleanValue());
                      } catch (ELException e) {
            throw new FacesException(e);
          }
        } else {
          component.setValueExpression("sortable", this._sortable);
        }
      }
                           
            if (this._visible != null) {
        if (this._visible.isLiteralText()) {
          try {
                       
            Boolean __visible = (Boolean) getFacesContext().
              getApplication().
                getExpressionFactory().
                  coerceToType(this._visible.getExpressionString(),
                      Boolean.class);
         
                        comp.setVisible(__visible.booleanValue());
                      } catch (ELException e) {
            throw new FacesException(e);
          }
        } else {
          component.setValueExpression("visible", this._visible);
        }
      }
                        
            if (this._width != null) {
        if (this._width.isLiteralText()) {
          try {
                       
            java.lang.String __width = (java.lang.String) getFacesContext().
              getApplication().
                getExpressionFactory().
                  coerceToType(this._width.getExpressionString(),
                      java.lang.String.class);
         
                        comp.setWidth(__width);
                      } catch (ELException e) {
            throw new FacesException(e);
          }
        } else {
          component.setValueExpression("width", this._width);
View Full Code Here

Examples of org.richfaces.component.html.HtmlColumn

     */
    protected void setProperties(UIComponent component)
    {
        // TODO Auto-generated method stub
        super.setProperties(component);
    HtmlColumn comp = (HtmlColumn) component;
             
            if (this._breakBefore != null) {
        if (this._breakBefore.isLiteralText()) {
          try {
                       
            Boolean __breakBefore = (Boolean) getFacesContext().
              getApplication().
                getExpressionFactory().
                  coerceToType(this._breakBefore.getExpressionString(),
                      Boolean.class);
         
                        comp.setBreakBefore(__breakBefore.booleanValue());
                      } catch (ELException e) {
            throw new FacesException(e);
          }
        } else {
          component.setValueExpression("breakBefore", this._breakBefore);
        }
      }
                        
            if (this._colspan != null) {
        if (this._colspan.isLiteralText()) {
          try {
                       
            Integer __colspan = (Integer) getFacesContext().
              getApplication().
                getExpressionFactory().
                  coerceToType(this._colspan.getExpressionString(),
                      Integer.class);
         
                        comp.setColspan(__colspan.intValue());
                      } catch (ELException e) {
            throw new FacesException(e);
          }
        } else {
          component.setValueExpression("colspan", this._colspan);
        }
      }
                        
            if (this._comparator != null) {
        if (this._comparator.isLiteralText()) {
          try {
                       
            java.util.Comparator __comparator = (java.util.Comparator) getFacesContext().
              getApplication().
                getExpressionFactory().
                  coerceToType(this._comparator.getExpressionString(),
                      java.util.Comparator.class);
         
                        comp.setComparator(__comparator);
                      } catch (ELException e) {
            throw new FacesException(e);
          }
        } else {
          component.setValueExpression("comparator", this._comparator);
        }
      }
                                   if(null != this._filterBy && this._filterBy.isLiteralText()){
          throw new IllegalArgumentException("Component org.richfaces.Column with Id " + component.getClientId(getFacesContext()) +" allows only EL expressions for property filterBy");
        }
      
            if (this._filterBy != null) {
        if (this._filterBy.isLiteralText()) {
          try {
                       
            java.lang.Object __filterBy = (java.lang.Object) getFacesContext().
              getApplication().
                getExpressionFactory().
                  coerceToType(this._filterBy.getExpressionString(),
                      java.lang.Object.class);
         
                        comp.setFilterBy(__filterBy);
                      } catch (ELException e) {
            throw new FacesException(e);
          }
        } else {
          component.setValueExpression("filterBy", this._filterBy);
        }
      }
                        
            if (this._filterEvent != null) {
        if (this._filterEvent.isLiteralText()) {
          try {
                       
            java.lang.String __filterEvent = (java.lang.String) getFacesContext().
              getApplication().
                getExpressionFactory().
                  coerceToType(this._filterEvent.getExpressionString(),
                      java.lang.String.class);
         
                        comp.setFilterEvent(__filterEvent);
                      } catch (ELException e) {
            throw new FacesException(e);
          }
        } else {
          component.setValueExpression("filterEvent", this._filterEvent);
        }
      }
                                 if(null != this._filterExpression && this._filterExpression.isLiteralText()){
          throw new IllegalArgumentException("Component org.richfaces.Column with Id " + component.getClientId(getFacesContext()) +" allows only EL expressions for property filterExpression");
        }
      
            if (this._filterExpression != null) {
        if (this._filterExpression.isLiteralText()) {
          try {
                       
            Boolean __filterExpression = (Boolean) getFacesContext().
              getApplication().
                getExpressionFactory().
                  coerceToType(this._filterExpression.getExpressionString(),
                      Boolean.class);
         
                        comp.setFilterExpression(__filterExpression.booleanValue());
                      } catch (ELException e) {
            throw new FacesException(e);
          }
        } else {
          component.setValueExpression("filterExpression", this._filterExpression);
        }
      }
                         if(null != this._filterMethod){
        ((HtmlColumn)component).setFilterMethod(this._filterMethod);
      }   
                  
            if (this._filterValue != null) {
        if (this._filterValue.isLiteralText()) {
          try {
                       
            java.lang.String __filterValue = (java.lang.String) getFacesContext().
              getApplication().
                getExpressionFactory().
                  coerceToType(this._filterValue.getExpressionString(),
                      java.lang.String.class);
         
                        comp.setFilterValue(__filterValue);
                      } catch (ELException e) {
            throw new FacesException(e);
          }
        } else {
          component.setValueExpression("filterValue", this._filterValue);
        }
      }
                         
            if (this._footerClass != null) {
        if (this._footerClass.isLiteralText()) {
          try {
                       
            java.lang.String __footerClass = (java.lang.String) getFacesContext().
              getApplication().
                getExpressionFactory().
                  coerceToType(this._footerClass.getExpressionString(),
                      java.lang.String.class);
         
                        comp.setFooterClass(__footerClass);
                      } catch (ELException e) {
            throw new FacesException(e);
          }
        } else {
          component.setValueExpression("footerClass", this._footerClass);
        }
      }
                         
            if (this._headerClass != null) {
        if (this._headerClass.isLiteralText()) {
          try {
                       
            java.lang.String __headerClass = (java.lang.String) getFacesContext().
              getApplication().
                getExpressionFactory().
                  coerceToType(this._headerClass.getExpressionString(),
                      java.lang.String.class);
         
                        comp.setHeaderClass(__headerClass);
                      } catch (ELException e) {
            throw new FacesException(e);
          }
        } else {
          component.setValueExpression("headerClass", this._headerClass);
        }
      }
                         
            if (this._label != null) {
        if (this._label.isLiteralText()) {
          try {
                       
            java.lang.String __label = (java.lang.String) getFacesContext().
              getApplication().
                getExpressionFactory().
                  coerceToType(this._label.getExpressionString(),
                      java.lang.String.class);
         
                        comp.setLabel(__label);
                      } catch (ELException e) {
            throw new FacesException(e);
          }
        } else {
          component.setValueExpression("label", this._label);
        }
      }
                          
            if (this._rowspan != null) {
        if (this._rowspan.isLiteralText()) {
          try {
                       
            Integer __rowspan = (Integer) getFacesContext().
              getApplication().
                getExpressionFactory().
                  coerceToType(this._rowspan.getExpressionString(),
                      Integer.class);
         
                        comp.setRowspan(__rowspan.intValue());
                      } catch (ELException e) {
            throw new FacesException(e);
          }
        } else {
          component.setValueExpression("rowspan", this._rowspan);
        }
      }
                        
            if (this._selfSorted != null) {
        if (this._selfSorted.isLiteralText()) {
          try {
                       
            Boolean __selfSorted = (Boolean) getFacesContext().
              getApplication().
                getExpressionFactory().
                  coerceToType(this._selfSorted.getExpressionString(),
                      Boolean.class);
         
                        comp.setSelfSorted(__selfSorted.booleanValue());
                      } catch (ELException e) {
            throw new FacesException(e);
          }
        } else {
          component.setValueExpression("selfSorted", this._selfSorted);
        }
      }
                        
            if (this._sortBy != null) {
        if (this._sortBy.isLiteralText()) {
          try {
                       
            java.lang.Object __sortBy = (java.lang.Object) getFacesContext().
              getApplication().
                getExpressionFactory().
                  coerceToType(this._sortBy.getExpressionString(),
                      java.lang.Object.class);
         
                        comp.setSortBy(__sortBy);
                      } catch (ELException e) {
            throw new FacesException(e);
          }
        } else {
          component.setValueExpression("sortBy", this._sortBy);
        }
      }
                        
            if (this._sortExpression != null) {
        if (this._sortExpression.isLiteralText()) {
          try {
                       
            java.lang.String __sortExpression = (java.lang.String) getFacesContext().
              getApplication().
                getExpressionFactory().
                  coerceToType(this._sortExpression.getExpressionString(),
                      java.lang.String.class);
         
                        comp.setSortExpression(__sortExpression);
                      } catch (ELException e) {
            throw new FacesException(e);
          }
        } else {
          component.setValueExpression("sortExpression", this._sortExpression);
        }
      }
                         
            if (this._sortIcon != null) {
        if (this._sortIcon.isLiteralText()) {
          try {
                       
            java.lang.String __sortIcon = (java.lang.String) getFacesContext().
              getApplication().
                getExpressionFactory().
                  coerceToType(this._sortIcon.getExpressionString(),
                      java.lang.String.class);
         
                        comp.setSortIcon(__sortIcon);
                      } catch (ELException e) {
            throw new FacesException(e);
          }
        } else {
          component.setValueExpression("sortIcon", this._sortIcon);
        }
      }
                        
            if (this._sortIconAscending != null) {
        if (this._sortIconAscending.isLiteralText()) {
          try {
                       
            java.lang.String __sortIconAscending = (java.lang.String) getFacesContext().
              getApplication().
                getExpressionFactory().
                  coerceToType(this._sortIconAscending.getExpressionString(),
                      java.lang.String.class);
         
                        comp.setSortIconAscending(__sortIconAscending);
                      } catch (ELException e) {
            throw new FacesException(e);
          }
        } else {
          component.setValueExpression("sortIconAscending", this._sortIconAscending);
        }
      }
                        
            if (this._sortIconDescending != null) {
        if (this._sortIconDescending.isLiteralText()) {
          try {
                       
            java.lang.String __sortIconDescending = (java.lang.String) getFacesContext().
              getApplication().
                getExpressionFactory().
                  coerceToType(this._sortIconDescending.getExpressionString(),
                      java.lang.String.class);
         
                        comp.setSortIconDescending(__sortIconDescending);
                      } catch (ELException e) {
            throw new FacesException(e);
          }
        } else {
          component.setValueExpression("sortIconDescending", this._sortIconDescending);
        }
      }
                        
            if (this._sortOrder != null) {
        if (this._sortOrder.isLiteralText()) {
          try {
                       
            org.richfaces.model.Ordering __sortOrder = (org.richfaces.model.Ordering) getFacesContext().
              getApplication().
                getExpressionFactory().
                  coerceToType(this._sortOrder.getExpressionString(),
                      org.richfaces.model.Ordering.class);
         
                        comp.setSortOrder(__sortOrder);
                      } catch (ELException e) {
            throw new FacesException(e);
          }
        } else {
          component.setValueExpression("sortOrder", this._sortOrder);
        }
      }
                        
            if (this._sortable != null) {
        if (this._sortable.isLiteralText()) {
          try {
                       
            Boolean __sortable = (Boolean) getFacesContext().
              getApplication().
                getExpressionFactory().
                  coerceToType(this._sortable.getExpressionString(),
                      Boolean.class);
         
                        comp.setSortable(__sortable.booleanValue());
                      } catch (ELException e) {
            throw new FacesException(e);
          }
        } else {
          component.setValueExpression("sortable", this._sortable);
        }
      }
                           
            if (this._visible != null) {
        if (this._visible.isLiteralText()) {
          try {
                       
            Boolean __visible = (Boolean) getFacesContext().
              getApplication().
                getExpressionFactory().
                  coerceToType(this._visible.getExpressionString(),
                      Boolean.class);
         
                        comp.setVisible(__visible.booleanValue());
                      } catch (ELException e) {
            throw new FacesException(e);
          }
        } else {
          component.setValueExpression("visible", this._visible);
        }
      }
                        
            if (this._width != null) {
        if (this._width.isLiteralText()) {
          try {
                       
            java.lang.String __width = (java.lang.String) getFacesContext().
              getApplication().
                getExpressionFactory().
                  coerceToType(this._width.getExpressionString(),
                      java.lang.String.class);
         
                        comp.setWidth(__width);
                      } catch (ELException e) {
            throw new FacesException(e);
          }
        } else {
          component.setValueExpression("width", this._width);
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.