Package org.richfaces.component

Examples of org.richfaces.component.UIDataTable


    Map<String, String> map = context.getExternalContext().getRequestParameterMap();
    String clientId = component.getClientId(context);
    if (SORT_FILTER_PARAMETER.equals(map.get(clientId))) {
      String sortColumnId = map.get(SORT_FILTER_PARAMETER);
      List<UIComponent> list = component.getChildren();
      UIDataTable table = (UIDataTable) component;
      boolean isSingleSortMode = !"multi".equals(table.getSortMode());
      for (Iterator<UIComponent> iterator = list.iterator(); iterator
          .hasNext();) {
        UIComponent child = iterator.next();
        if (child instanceof org.richfaces.component.UIColumn) {
          org.richfaces.component.UIColumn column = (org.richfaces.component.UIColumn) child;
          child.setId(child.getId());
          if (sortColumnId != null) {
            if (sortColumnId.equals(child.getClientId(context))) {
              String id = child.getId();
              Collection<Object> sortPriority = table.getSortPriority();
              if (isSingleSortMode) {
                sortPriority.clear();
              }
              if(!sortPriority.contains(id)) {
                sortPriority.add(id);
View Full Code Here


    String clientId = control.getClientId(context);
    ExternalContext externalContext = context.getExternalContext();
    Map<String, String> parameterMap = externalContext.getRequestParameterMap();
    String string = parameterMap.get(clientId);
    if (string != null) {
      UIDataTable table = control.getTable();
     
      new SortEvent2(table, control.getSortExpression());
     
      AjaxContext ajaxContext = AjaxContext.getCurrentInstance();
     
View Full Code Here

        return parent;
    }

    public String getParentTableClientId() {
        UIDataTable dataTable = (UIDataTable) getFirstParent(UIDataTable.class);
        return dataTable.getClientId();
    }
View Full Code Here

        UIDataTable dataTable = (UIDataTable) getFirstParent(UIDataTable.class);
        return dataTable.getClientId();
    }

    public Collection<UIColumn> getTableColumns() {
        UIDataTable dataTable = (UIDataTable) getFirstParent(UIDataTable.class);
        Set<UIColumn> cols = new HashSet<UIColumn>();

        for (UIComponent child : dataTable.getChildren()) {
            if (child instanceof UIColumn) {
                cols.add((UIColumn) child);
            }
        }
View Full Code Here

     
    if (inmobleForm.isCercable())
    {
      inmobleForm.getContainerHtmlDataTableFS().getChildren().clear();
                 
      UIDataTable datatable = HtmlDinamic.buildDatatableFS(
          "dyn_taulaInmobles",
          "#{inmobleForm.dataModel}",
          lc,
          inmobleForm.getColumnesVisibles(),
          10,
          "odd-row, even-row",
          "stable",
          "datatable");
     
      inmobleForm.getContainerHtmlDataTableFS().getChildren().add(datatable);
     
    }
    else 
    {
      inmobleForm.getContainerHtmlDataTableVenedor().getChildren().clear()
           
      UIDataTable datatable = HtmlDinamic.buildDatatable(
          "dyn_taulaInmoblesVenedor",
          "#{inmobleForm.inmoblesVenedorCaract}",
          lc,
          inmobleForm.getColumnesVisibles(),
          10,
View Full Code Here

        //tipus.setKey(keyTipus);
       
        List<Caracteristiques> lc = caracteristiquesFinder.caractTipus(tipus,1, true);
    
     
      UIDataTable datatable = HtmlDinamic.buildDatatableFS(
          "dyn_taulaInmobles",
          "#{inmobleForm.dataModel}",
          lc,
          columnesVisibles,
          10,
View Full Code Here

        Tipus tipus = new Tipus();
        //tipus.setKey(keyTipus);
       
        List<Caracteristiques> lc = caracteristiquesFinder.caractTipus(tipus,1, true)// caracteristiques per tipus d'inmoble , INCLOU LES CARACT COMUNES I NO BOOLEANES
       
      UIDataTable datatable = HtmlDinamic.buildDatatable(
              "dyn_taulaInmoblesVenedor",
              "#{inmobleForm.inmoblesVenedorCaract}",
              lc,
              columnesVisibles,
              10,
View Full Code Here

      )
  {
   
    Application application = FacesContext.getCurrentInstance().getApplication();
       
    UIDataTable htmlDataTable = (UIDataTable) application.createComponent(UIDataTable.COMPONENT_TYPE);

      htmlDataTable.setId(componentID);
    htmlDataTable.setVar("item");
    htmlDataTable.setRows(numRows);
    htmlDataTable.setRowClasses("odd-row,even-row")// MOLT IMPORTANT SI VOLEM APLICAR EL PLUGIN TABLESORTER
                           // SINO , odd-row,even-row
    htmlDataTable.setStyleClass("stable")// DE JQUERY !!!!!!!!!!!!!!!!!!!!
                           // stable
   
    htmlDataTable.setIterationStatusVar("it");
    htmlDataTable.setRowKeyVar("#{item}");
    /////////////htmlDataTable.setStyle(style);
   
   
   
    //htmlDataTable.setOnrowmouseover("function(){jQuery(this).children('#solicitantsInmoble').fadeIn('fast')};");
    //htmlDataTable.setOnrowmouseout("this.style.backgroundColor='#{a4jSkin.rowBackgroundColor}';");
    
    htmlDataTable.setTransient(true);
   
    htmlDataTable.setValueExpression("value", (ValueExpression) Utils.resolveExpression(valueExpression));
    
   
      // afegim la referencia/id de l'inmoble
      htmlDataTable.getChildren().add(buildColumnID(1L ,
          "#{item.idInmoble}",
          "ID",
          "VCHR",
          "ITXT",
          false,
          "color:black;background:gray;"));
   
      // Columnes datatable segons la Hashtable columnesVisibles de visibilitats
      Set<Long> idsColumnes = columnesVisibles.keySet();
     
     
      Iterator<Caracteristiques> caracteristiquesIter = lc.iterator();
      while (caracteristiquesIter.hasNext())
      {
        Caracteristiques caracteristica = (Caracteristiques) caracteristiquesIter.next();
       
        UIColumn columna = buildColumn(
            caracteristica.getCaracteristicaKey() ,
            "#{item.caractInmobles[" + caracteristica.getCaracteristicaKey() + "]}",
            "#{inmobleForm.columnesVisibles[" + caracteristica.getNom() + "]}",
            caracteristica.getNom(),
            caracteristica.getTtpbasic().getBdtype(),
            caracteristica.getTtpcontrol().getTipus(),
            0// minim nombre digits o chars
            caracteristica.getTamanyControl() == null ? 0 : caracteristica.getTamanyControl().intValue()// maxim nombre digits o chars
            caracteristica.isModificable(),
            new ArrayList<String>(){/**
             *
             */
            private static final long serialVersionUID = 1L;

          {add(componentID);}},
            new ArrayList<String>(){/**
             *
             */
            private static final long serialVersionUID = 1L;

          {add("@this");}})
       
        htmlDataTable.getChildren().add(columna);
     
      }
     
 
      /*-----------------------------------------------*/
      /* afegim (si cal) la columna amb butons/links   */
      /*-----------------------------------------------*/
      htmlDataTable.getChildren().add(buildColumnAmbLink(1L,
          "solicitud",
          "headerTextValue",
          "#{inmobleForm.solicitarInmobles}",
          1,
          true,
          null,
          "/images/bSelectNR.gif",
          "Solicitar Inmueble",
          new ArrayList<String>(){/**
           *
           */
          private static final long serialVersionUID = 1L;

        {add("dyn_taulaInmobles");add(componentID);}},
          new ArrayList<String>(){/**
           *
           */
          private static final long serialVersionUID = 1L;

        {add("@this");}}));
     
      htmlDataTable.getChildren().add(buildColumnAmbLink(2L,
          "eliminar","headerTextValue",
          "#{inmobleForm.esborrarInmobles}",
          1,
          true,
          null,
          "/images/16-em-cross.png",
          "Eliminar Inmueble",
          new ArrayList<String>(){/**
           *
           */
          private static final long serialVersionUID = 1L;

        {add("dyn_taulaInmobles");add(componentID);}},
          new ArrayList<String>(){/**
           *
           */
          private static final long serialVersionUID = 1L;

        {add("@this");}}));
     
      htmlDataTable.getChildren().add(buildColumnAmbLink(3L,
          "modificar","headerTextValue",
          "#{inmobleForm.modificarInmobles}",
          1,
          true,
          null,
          "/images/update.gif",
          "Modificar Inmueble",
          new ArrayList<String>(){/**
           *
           */
          private static final long serialVersionUID = 1L;

        {add("dyn_taulaInmobles");add(componentID);}},
          new ArrayList<String>(){/**
           *
           */
          private static final long serialVersionUID = 1L;

        {add("@form");}}));
    
     
        htmlDataTable.getFacets().put("footer", buildDatascroller("dyn_datascroller"));
   
      return htmlDataTable;
 
  }
View Full Code Here

      )
  {
   
    Application application = FacesContext.getCurrentInstance().getApplication();
       
    UIDataTable htmlDataTable = (UIDataTable) application.createComponent(UIDataTable.COMPONENT_TYPE);

      htmlDataTable.setId(componentID);
    htmlDataTable.setVar("item");
    htmlDataTable.setRows(numRows);
    htmlDataTable.setRowClasses(rowClasses);
    htmlDataTable.setStyleClass(styleClass);
    htmlDataTable.setIterationStatusVar("it");
    htmlDataTable.setRowKeyVar("#{item}");
    //htmlDataTable.setStyle(style);
    
    htmlDataTable.setTransient(true);
   
    htmlDataTable.setValueExpression("value", (ValueExpression) Utils.resolveExpression(valueExpression));
  
   
     // afegim la referencia/id de l'inmoble
      htmlDataTable.getChildren().add(buildColumnID(
          1L ,
          "#{item.idInmoble}",
          "ID",
          "VCHR",
          "ITXT",
          false,
          "color:red;"));
   
      // Columnes datatable segons la Hashtable columnesVisibles de visibilitats
      Set<Long> idsColumnes = columnesVisibles.keySet();
       
      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(),
            caracteristica.getTtpcontrol().getTipus(),
            0,
            caracteristica.getTamanyControl() == null ? 0 : caracteristica.getTamanyControl().intValue())
       
       
        System.out.println("ID/Caract : " + caracteristica.getCaracteristicaKey() + "/" + caracteristica.getNom() + "\n");
        System.out.println("Tipus BD : " + caracteristica.getTtpbasic().getKey());
        System.out.println("Tipus Control : " + caracteristica.getTtpcontrol().getKey());
       
        htmlDataTable.getChildren().add(columna);
     
      }
     
      /*---------------------------------------------*/
      /* afegim (si cal) columnes amb butons/links   */
      /*---------------------------------------------*/
      htmlDataTable.getChildren().add(buildColumnAmbLink(
          1L,
          "solicitud",
          "headerTextValue",
          "#{inmobleForm.solicitarInmobles}",
          1,
          true,
          null,
          "/images/bSelectNR.gif",
          "Solicitar Inmueble",
          new ArrayList<String>(){/**
           *
           */
          private static final long serialVersionUID = 1L;

        {add(componentID);}},
          new ArrayList<String>(){/**
           *
           */
          private static final long serialVersionUID = 1L;

        {add("@this");}}));
     

   
        htmlDataTable.getFacets().put("footer", buildDatascroller("dyn_datascrollerFS"));
   
     
      return htmlDataTable;
 
  }
View Full Code Here

   * @param component
   * @param facetName
   * @throws IOException
   */
  private void encodeHeaderRow(ResponseWriter writer, FacesContext context, UIComponent component,String facetName) throws IOException {
    UIDataTable dataTable = (UIDataTable) component;
    Iterator headers = columnFacets(dataTable,facetName);
    String headerClass = (String) component.getAttributes().get(
        facetName+"Class");
    if (headers.hasNext()) {
      encodeHeaderRowStart(context,"dr-subtable-"+facetName+" rich-subtable-"+facetName ,headerClass, dataTable, writer);
View Full Code Here

TOP

Related Classes of org.richfaces.component.UIDataTable

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.