2 Replies Latest reply on Aug 25, 2011 1:14 PM by ionutbarau

    using width=auto for rich:column does not work

    asookazian

      RF 3.3.1.GA

      I have a scrollableDataTable and need the column widths to auto-size (they are not wide enough by default in some cases). I tried the following:

      <rich:scrollableDataTable id="equipmentManagementHistoryTable"
       value="#{equipmentManagementHistoryList}"
       var="history"
       width="750px"
       height="200px"
       rendered="#{equipmentManagementHistoryList.getRowCount() gt 0}">
       <rich:column sortable="false"
       width="auto">
       <f:facet name="header"><h:outputText value="ICOMS Description"/></f:facet>
       <h:outputText value="#{history.icomsItemDescription}"/>
       </rich:column>
       <rich:column sortable="false"
       width="auto">
       <f:facet name="header"><h:outputText value="Equipment Type"/></f:facet>
       <h:outputText value="#{recoveredEquipmentManagement.getEquipmentTypeDescription(history.equipmentType)}"/>
       </rich:column>
       <rich:column sortable="false"
       width="auto">
       <f:facet name="header"><h:outputText value="Letter Description"/></f:facet>
       <h:outputText value="#{history.letterDescription}"/>
       </rich:column>
       <rich:column sortable="false"
       width="auto">
       <f:facet name="header"><h:outputText value="Recovery Type"/></f:facet>
       <h:outputText value="#{recoveredEquipmentManagement.getRecoveryTypeDescription(history.recoveryType)}"/>
       </rich:column>
       <rich:column sortable="false"
       width="auto">
       <f:facet name="header"><h:outputText value="Created By"/></f:facet>
       <h:outputText value="#{history.recoveredEquipmentManagement.applicationUserByUpdatedByUserId.userName}"/>
       </rich:column>
       <rich:column sortable="false"
       width="auto">
       <f:facet name="header"><h:outputText value="Created Date"/></f:facet>
       <h:outputText value="#{history.addedDate}">
       <s:convertDateTime type="both" timeStyle="medium" dateStyle="short"/>
       </h:outputText>
       </rich:column>
       </rich:scrollableDataTable>


      And get:

      An Error Occurred:
      For input string: "auto"
      +- Stack Trace
      java.lang.NumberFormatException: For input string: "auto"
       at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
       at java.lang.Integer.parseInt(Integer.java:447)
       at java.lang.Integer.parseInt(Integer.java:497)


      How to auto-size now? thx.