Package org.richfaces.component

Examples of org.richfaces.component.UIColumn


      Iterator<Caracteristiques> caracteristiquesIter = lc.iterator();
      while (caracteristiquesIter.hasNext())
      {
        Caracteristiques caracteristica = (Caracteristiques) caracteristiquesIter.next();
       
        UIColumn columna = buildColumnSortFilter(
            caracteristica.getCaracteristicaKey() ,
            "#{item.caractInmobles[" + caracteristica.getCaracteristicaKey() + "]}",
            "#{inmobleForm.columnesVisibles[" + caracteristica.getNom() + "]}",
            caracteristica.getNom(), "",
            caracteristica.getTtpbasic().getBdtype(),
View Full Code Here


      ArrayList<String> executeList)
  {
   
    Application application = FacesContext.getCurrentInstance().getApplication();
   
    UIColumn column = (UIColumn) application.createComponent(UIColumn.COMPONENT_TYPE);
   
    column.setId("columnAmbLink_" + displayValue)
    column.setTransient(true);
   
       UICommandLink clSolInmoble = buildCommandLinkRich(
                   "clr_" + displayValue ,
                   null,
                   renderList , 
                   executeList);
      
       clSolInmoble.setActionExpression(Utils.createAction(action, String.class))
   
       // ValueExpression "value" de la imatge
    ValueExpression v = (ValueExpression) Utils.resolveExpression(imatge);
    HtmlGraphicImage gisolInmoble = buildGraphicImage(
                "clr_gr_" + displayValue,
                v,
                toolTip);
   
    clSolInmoble.getChildren().add(gisolInmoble);
   
    // setPropertyBean inmoble seleccionat
    clSolInmoble.addActionListener(setPropertyActionListener(
                "#{inmobleForm.currentInmobleIndex}",
                "#{item.idInmoble}",
                Integer.class));
   
   
    clSolInmoble.addActionListener(setPropertyActionListener(
        "#{inmobleForm.currentInmobleCaract}",
        "#{item}",
        InmobleCaract.class));

   

    column.getChildren().add(clSolInmoble);
   
   
    return column;
  }
View Full Code Here

      String style)
  {
   
    Application application = FacesContext.getCurrentInstance().getApplication();
   
    UIColumn column = (UIColumn) application.createComponent(UIColumn.COMPONENT_TYPE);
   
    column.setId("columnID_" + idColumna)
    column.setTransient(true);
   
    HtmlOutputText header = new HtmlOutputText();
      header.setValue(nomColumna + " " + idColumna);
      header.setTransient(true);
     
      column.setHeader(header);
      column.setStyle(style);
  
      HtmlOutputText ot = buildOutputText(
          "columnID_ot_" + nomColumna ,
          (ValueExpression) Utils.resolveExpression(valueExpression));
       
      column.getChildren().add(ot);
   
    return column;
  }
View Full Code Here

      ArrayList<String> renderList,
      ArrayList<String> executeList)
  {
    Application application = FacesContext.getCurrentInstance().getApplication();
     
    UIColumn column = (UIColumn) application.createComponent(UIColumn.COMPONENT_TYPE);
   
    column.setId("column_" + idColumna)
    column.setTransient(true);
   
    HtmlOutputText header = new HtmlOutputText();
      header.setValue(nomColumna + " " + idColumna);
      header.setTransient(true);
     
      column.setHeader(header);

      ///////////column.setValueExpression("rendered", (ValueExpression) Utils.resolveExpression(valueExpressionRendered)); 
   
     
      // EN FUNCIO DE SI ES EDITABLE O NO inputText/outputText
 
      if (modificable)
      {
     
        if (tipusColumna.compareTo("BOOL") == 0)
        {
       
          UICommandLink cl = butoneraBooleana(idColumna);
         
          column.getChildren().add(cl);
       
        }
        else
        {
          ValueExpression v4 =  (ValueExpression) Utils.resolveExpression(valueExpression);
       
          HtmlInputText it = buildInputText("column_it_" + idColumna ,
              v4,
              "width:50px",
              20,
              ""
              tipusColumna.compareTo("INT") == 0 ? "valor numérico" : "valor incorrecto",
              tipusColumna,
              false,
              false,   // transient !!!!!!
              minimum,
              maximum);
           
         
        column.getChildren().add(it);
       
       
        UIPopupPanel popupPanel = buildPopupPanel("inputText_column_it_" + idColumna);
       
        // missatge error corresponent al inputtext
        UIRichMessage richMessage = buildMessageRich(
            "inputText_column_it_" + idColumna,
            "color:red;font-weight:bold",
            true);
       
        ////popupPanel.getChildren().add(richMessage);
       
        column.getChildren().add(richMessage);
       
       
        }
   
      }
      else
      {
     
        HtmlOutputText ot = buildOutputText("column_ot_" + nomColumna ,
            (ValueExpression) Utils.resolveExpression(valueExpression));
       
        column.getChildren().add(ot);
      }
 
   
   
    return column;
View Full Code Here

      int maximum)
  {
   
    Application application = FacesContext.getCurrentInstance().getApplication();
     
    UIColumn column = (UIColumn) application.createComponent(UIColumn.COMPONENT_TYPE);
   
    column.setId("columnSortFilter_" + idColumna)
    column.setTransient(true);
   
      // ValueExpression per "rendered" (visible/invisible columna)
      /*column.setValueExpression(
          "rendered",
          (ValueExpression) Utils.resolveExpression(valueExpressionRendered)); */
   
      HtmlOutputText otColumn;
   
 
      if (tipusColumna.compareTo("BOOL") != 0)
    {
      // Header columna
        HtmlOutputText header = new HtmlOutputText();
     
      header.setId("hd_" + idColumna)
     
        header.setValue(nomColumna);
        header.setTransient(true);
        column.setHeader(header);
     
      // SI ES UN DATATABLE AMB SUPORT FILTERING/SORTING
        column = afegirSortingFilteringColumn(
            idColumna,
            nomColumna,
            column,
            tipusColumna,
            tipusControl,
            minimum,
            maximum);
       
        otColumn = buildOutputText(
            "columnSortFilter_ot_" + idColumna,
            (ValueExpression) Utils.resolveExpression(valueExpression));
        
      column.getChildren().add(otColumn);
    }
    else
    {
      column = afegirSortingFilteringColumn(
          idColumna,
          nomColumna,
          column,
          tipusColumna,
          tipusControl,
          minimum,
          maximum);
     
     
      Random rndInm = new Random()
      int numAleatInm = rndInm.nextInt(3000);
     
     
      // ValueExpression del "value" del graphicImage segons si te o no la caracteristica booleana
      ValueExpression v = (ValueExpression) Utils.resolveExpression(valueExpression + " ? '/images/bSaveNR.gif' : '/images/chkOff.gif'}");
     
      HtmlGraphicImage teCaract = buildGraphicImage(
          "teCaract_" + numAleatInm + "_" + idColumna,
          v,
          valueExpression);
       
      column.getChildren().add(teCaract);
   
    }
   
   
    return column;
View Full Code Here

        return menuId;
    }// render

    protected void renderMenuItem(UIColumn column) throws IOException {
        if (column instanceof UIColumn) {
            UIColumn dataColumn = (UIColumn) column;
            Boolean v = dataColumn.isVisible();
            boolean columnVisible = (v == null ? Boolean.TRUE : v);
            String actionScript = null;
            if ((!columnVisible) || (visibleColumnsCount > 1)) {
                boolean ajaxSingle = true;
                Map<String, Object> requestOpts = AjaxRendererUtils
                        .buildEventOptions(context, dataColumn, true);

                if (onAjaxCompleteFunction != null)
                    requestOpts.put(AjaxRendererUtils.ONCOMPLETE_ATTR_NAME,
                            onAjaxCompleteFunction);

                @SuppressWarnings("unchecked")
                Map<String, Object> parameters = (Map<String, Object>) requestOpts
                        .get("parameters");
                if (parameters == null) {
                    parameters = new HashMap<String, Object>();
                    requestOpts.put("parameters", parameters);
                }
                if (ajaxSingle) {
                    if (!parameters
                            .containsKey(AjaxRendererUtils.AJAX_SINGLE_PARAMETER_NAME))
                        parameters.put(
                                AjaxRendererUtils.AJAX_SINGLE_PARAMETER_NAME,
                                dataColumn.getParent().getClientId(context));
                    if (!requestOpts.containsKey("control"))
                        requestOpts.put("control", JSReference.THIS);
                }
                parameters.put(dataColumn.getParent().getClientId(context)
                        + ":" + CHANGE_COL_VISIBILITY, dataColumn.getId());

                JSFunction dropFunction = AjaxRendererUtils.buildAjaxFunction(
                        dataColumn, context);
                dropFunction.addParameter(requestOpts);
                actionScript = dropFunction.toScript();
            }// if

            writer.startElement("li", dataColumn);
            writer.writeAttribute(HTML.class_ATTRIBUTE, "dt-menu-list-item"
                    + (columnVisible ? " dt-menu-item-checked" : ""), null);

            writer.startElement(HTML.a_ELEMENT, dataColumn);
            writer.writeAttribute(HTML.HREF_ATTR, "#", null);
            writer.writeAttribute(HTML.class_ATTRIBUTE,
                    "dt-menu-item dt-menu-check-item", null);
            actionScript = (actionScript == null ? "return false;"
                    : actionScript + ";return false;");
            writer.writeAttribute(HTML.onclick_ATTRIBUTE, actionScript, null);
            writer.startElement(HTML.IMG_ELEMENT, dataColumn);
            writer.writeAttribute(HTML.class_ATTRIBUTE, "dt-menu-item-icon",
                    null);
            InternetResource res = InternetResourceBuilder.getInstance().getResource("/org/richfaces/renderkit/html/images/s.gif");
            writer.writeAttribute(HTML.src_ATTRIBUTE, InternetResourceBuilder
          .getInstance().getUri(res, context, null), null);
            writer.endElement(HTML.IMG_ELEMENT);
            String label = (String)dataColumn.getAttributes().get("label");
            writer.writeText(label == null ? "" : label, null);
            writer.endElement(HTML.a_ELEMENT);
            writer.endElement("li");
        }
    }// encodeMenuItem
View Full Code Here

     */
    private boolean filteringEnabled(UIExtendedDataTable table) {
        Iterator<UIColumn> columns = table.getSortedColumns();
        boolean enabled = false;
        while (columns.hasNext()) {
            UIColumn col = columns.next();
            if ((internalFilterEnabledColumn(col) || (col.getFacet("filter") != null)) &&
                col.isRendered()
        ) {
        enabled = true;
        break;
      }
        }
View Full Code Here

            ResponseWriter writer, UIDataTable table,
            Iterator<UIColumn> headers, String skinCellClass,
            String headerClass, String facetName, String element)
            throws IOException {
        while (headers.hasNext()) {
            UIColumn column = headers.next();
            if (column instanceof UIColumn) {
                if (column.isRendered()) {
                    writer.startElement(element, table);
                    String classAttribute = facetName + "Class";
                    String columnHeaderClass = (String) column.getAttributes()
                            .get(classAttribute);
                    encodeStyleClass(writer, null, skinCellClass, headerClass,
                            columnHeaderClass);
                    UIColumn dataColumn = (UIColumn) column;
                    if (internalFilterEnabledColumn(dataColumn)) {
                        writer.startElement(HTML.DIV_ELEM, column);
                        addInplaceInput(context, column);
                        writer.endElement(HTML.DIV_ELEM);
                    }
                    else if (dataColumn.getFacet("filter") != null) {
                      writer.startElement(HTML.DIV_ELEM, column);
                      dataColumn.getFacet("filter").encodeAll(context);
                      writer.endElement(HTML.DIV_ELEM);
                    }
                    else {
                      encodeNBSP(writer);
                    }
View Full Code Here

        // RichHeaderEncodeStrategy();
        // HeaderEncodeStrategy simpleEncodeStrategy = new
        // SimpleHeaderEncodeStrategy();

        while (headers.hasNext()) {
            UIColumn column = headers.next();
            if (isColumnRendered(column)) {
                if ((Integer) column.getAttributes().get("colspan") != null) {
                    t_colCount = t_colCount
                            + ((Integer) column.getAttributes().get("colspan"))
                                    .intValue();
                } else {
                    t_colCount++;
                }
                if (t_colCount > colCount) {
                    break;
                }

                String classAttribute = facetName + "Class";
                String columnHeaderClass = (String) column.getAttributes().get(
                        classAttribute);

                writer.startElement(element, column);
                encodeStyleClass(writer, null, skinCellClass, headerClass,
                        columnHeaderClass);
                writer.writeAttribute("scope", "col", null);
                getUtils().encodeAttribute(context, column, "colspan");

                boolean sortableColumn = column
                        .getValueExpression("comparator") != null
                        || column.getValueExpression("sortBy") != null;
                column.getAttributes().put("sortable",
                        Boolean.valueOf(sortableColumn));

                HeaderEncodeStrategy strategy = (column instanceof UIColumn && "header"
                        .equals(facetName)) ? new G3HeaderEncodeStrategy()
                        : new SimpleHeaderEncodeStrategy();

                strategy.encodeBegin(context, writer, column, facetName,
                        sortableColumn);

                UIComponent facet = column.getFacet(facetName);
                if (facet != null && isColumnRendered(facet)) {
                    renderChild(context, facet);
                }

                strategy.encodeEnd(context, writer, column, facetName,
View Full Code Here

        UIExtendedDataTable table = holder.getTable();
        ResponseWriter writer = context.getResponseWriter();
        Iterator<UIColumn> iter = table.getSortedColumns();
        boolean first = true;
        int currentColumn = 0;
        UIColumn column = null;
        if (holder.isFirstRow()) {
            encodeFakeIeRow(context, table, holder);
        }
        if (holder.isGroupingOn() && (rowGroupChanged(context, holder))) {
            encodeGroupRow(context, table, holder);
        }
        holder.setFirstRow(false);
       
        while (iter.hasNext()) {
            column = iter.next();
            // Start new row for first column - expect a case of the detail
            // table, wich will be insert own row.
            boolean isRow = (column instanceof Row);
            if (first && !isRow) {
                encodeRowStart(context, getFirstRowSkinClass(), holder
                        .getRowClass(), table, holder, writer);
            }

            // TODO PKA CHANGE COLUMN RENDERER TO GET RID OF && false
//            if (false && (column instanceof Column)) {
//                boolean breakBefore = ((Column) column).isBreakBefore()
//                        || isRow;
//                if (breakBefore && !first) {
//                    // close current row
//                    writer.endElement(HTML.TR_ELEMENT);
//                    // reset columns counter.
//                    currentColumn = 0;
//                    // Start new row, expect a case of the detail table, wich
//                    // will be insert own row.
//                    if (!isRow) {
//                        holder.nextRow();
//                        encodeRowStart(context, holder.getRowClass(), table,
//                                holder, writer);
//                    }
//                }
//                encodeCellChildren(context, column,
//                        first ? getFirstRowSkinClass() : null,
//                        getRowSkinClass(), holder.getRowClass(),
//                        getCellSkinClass(), holder
//                                .getColumnClass(currentColumn));
//                // renderChild(context, column);
//                if (isRow && iter.hasNext()) {
//                    // Start new row for remained columns.
//                    holder.nextRow();
//                    encodeRowStart(context, holder.getRowClass(), table,
//                            holder, writer);
//                    // reset columns counter.
//                    currentColumn = -1;
//                }
//            } else
            if (column.isRendered()) {
                // UIColumn don't have own renderer
                writer.startElement(HTML.td_ELEM, table);
                getUtils().encodeId(context, column);
                encodeStyleClass(writer, null, getCellSkinClass(), holder.getColumnClass(currentColumn),
                        column.getAttributes().get("styleClass"));
                encodeStyle(writer, null, null, null, column.getAttributes().get("style"));
                // TODO - encode column attributes.
                writer.startElement(HTML.DIV_ELEM, table);
                writer.writeAttribute("class", "extdt-cell-div", null);
                // IE
                renderChildren(context, column);
View Full Code Here

TOP

Related Classes of org.richfaces.component.UIColumn

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.