1 Reply Latest reply on Jun 9, 2011 4:43 AM by snaker

    Column Width in Richfaces Extended Data Table

    rajkumarsrikanth

      Hi Everyone,

       

      Is there a way where the column width in richfaces extended data table automatically expands to accomodate the data in the table.

      The column width cannot be hard-coded as the project is driven from the database.

      Based on the data in the table, the column width should expand automatically and will be provided with a horizontal scroll.

       

      The first column should not wrap itself and the data in the table should be completely visible ( not hidden or overlaid by the column border)

       

       

       

      <h:form>
          <h:panelGrid>
              <rich:panel header="Login">
                  <rich:extendedDataTable id="sampleData1" value="#{person.dataModel}" var="item" rows="10" 
                      selectionMode="single"
                      selection="#{person.dataModel.selection}">
      
                      <a4j:ajax event="selectionchange" execute="@form" 
                          listener="#{person.dataModel.selectionListener}" />
                      <rich:column>
                          <f:facet name="header">Modelasdfkjjjjjjjjjjjjjjjjjjjjjjjjjjjj asdklfjjjjjjjjjjjjjjjjjjjjjjjjjjjjj asdklfjjjjjjjjjj</f:facet>
                          <h:outputText value="#{item.model}" />
                      </rich:column>
                      <rich:column>
                          <f:facet name="header">Mileagea</f:facet>
                          <h:outputText value="#{item.mileage}" />
                      </rich:column>
                  </rich:extendedDataTable>
                  <rich:dataScroller for="sampleData1" />
              </rich:panel>
          </h:panelGrid>
      </h:form>