3 Replies Latest reply on May 25, 2010 6:23 AM by nbelaevski

    setWidth on HtmlColumn ignored when showing rich:columns

    quajo

      Hi, I´m using a extendeddatable for showing some rows of data, and inside of it i have a rich:columns component. When I build the columns with new HtmlColumn( ) I call the method setWidth for each one, but in the view no column is shown with the width that I set by calling setWidth.A Similiar thing happens when I call setVisible(false), the column is still being shown.

       

      Appreciate any Help, please. It´s urgent.

       

      Thx.

        • 1. Re: setWidth on HtmlColumn ignored when showing rich:columns
          ilya_shaikovsky

          please add code snippets.. it will make investigation easier and much faster.

          • 2. Re: setWidth on HtmlColumn ignored when showing rich:columns
            quajo

            This is the declaration of the extendedDataTable:

             

            <a4j:form>
                    <rich:extendedDataTable height="140px"
                                id="actList" rows="0" var="act" sortMode="single"
                                binding="#{visBean.tableAct}" value="#{visBean.listaAct}" selection="#{visBean.selection}" styleClass="scroll" enableContextMenu="false">
                                <a4j:support event="onRowClick" action="#{visBean.buscaSeleccion}"
                                    oncomplete="selectG(data);" data="#{visBean.allElems}" id="clickRowAct" />                   
                                    <rich:columns width="100px" value="#{visBean.columns}" var="colum" index="index">
                                          <f:facet name="header">
                                              <h:outputText value="#{colum.title}" />
                                          </f:facet>
                                    <h:outputText value="#{act[colum.label]}" />
                                    </rich:columns>                       
                            </rich:extendedDataTable>
                            </a4j:form>  

             

            and the code in the bean when dynamic columns are created is the following:

             

                            HtmlColumn c1 = new HtmlColumn();       
                             c1.setTitle("id");
                             c1.setLabel("id");

                             c1.setWidth("130px"
                             columns.add(c1);
                             HtmlColumn c2 = new HtmlColumn();       
                             c2.setTitle("mp");
                             c2.setLabel("mp"); 

                             c2.setWidth("130px");       
                               columns.add(c2);
                             HtmlColumn c3 = new HtmlColumn();       
                             c3.setTitle("pl");
                             c3.setLabel("pl"); 

                             c3.setWidth("70px");

                             c3.setVisible(false);
                              columns.add(c3);

             

             

            where columns is declared as:  private ArrayList<HtmlColumn> columns = new ArrayList<HtmlColumn>();

            and rows is an ArrayList of objects which fields are called: id, mp and pl and they have their respective getters and setters.

             

            According to the previous code c3 shouldn´t be shown but it is. The width isn't updated either.

             

            Thanks.

            • 3. Re: setWidth on HtmlColumn ignored when showing rich:columns
              nbelaevski

              Hi,

               

              rich:columns accept list of objects, not list of UIColumn components. If you want to use list of UIColumn, use c:forEach then.