We use rich:orderingList with the following attributes listHeight="auto" listWidth="auto", this causes it to auto re-size and if there are smaller strings within the list, the list width is very small. We would prefer to have a minimum size for smaller strings and should change to auto for larger strings. How do we achieve this?
+3
A:
You can set the width each column separately and with EL expression set width either fixed size or auto.
So if for example your Item value is of type String
<rich:orderingList value="#{bean.simpleItems}" var="item" selection="#{bean.selection}" controlsType="button">
<rich:column width="#{item.name.length > 100 ? 'auto' : '100px'}">
<f:facet name="header">
<h:outputText value="Car Name" />
</f:facet>
<h:outputText value="#{item.name}" />
</rich:column>
</rich:orderingList>
Another option is through columnClasses
property of rich:orderingList. You can define in the backing bean the CSS classes considering the maximum width of each String, and using it as ELExperssion: columnClasses="#{myBean.columnWidth}"
Odelya
2010-09-29 11:22:07
good one :-) ..
org.life.java
2010-09-29 11:51:22
thanks for the excellent suggestion, we are using the first option
Joshua
2010-10-01 04:26:54