-
1. Re: columnsWidth official support in RF 4.x
healeyb Aug 31, 2012 12:16 PM (in response to strannik)1 of 1 people found this helpfulIt does have a width attribute, i.e. rich:column width="100px"
Regards,
Brendan.
-
2. Re: columnsWidth official support in RF 4.x
strannik Aug 31, 2012 2:58 PM (in response to healeyb)Sorry, Brendan.
Yes, it does have the width attribute according to the documentation.
However it is not actually used. Here is my sample that worked in 3.3.3
<rich:dataTable value="#{products}" var="product" styleClass="maxwidth" rows="15" rowClasses="each-row" headerClass="header-row"> <rich:column sortBy="#{product.name}"> <f:facet name="header"> <h:outputText value="#{msg['product.name']}" /> </f:facet> <h:outputText value="#{product.name}" /> </rich:column> <rich:column width="30px"> <h:graphicImage url="/resources/images/edit.gif" alt="Edit" /> </rich:column> </rich:dataTable> The width of the second column is arbitrary until I setup columnsWidth=",30px" for the whole table.
I use RF 4.2.2
-
3. Re: columnsWidth official support in RF 4.x
healeyb Aug 31, 2012 3:10 PM (in response to strannik)I think the problem is that you're not specifying a width for the first column, it works ok for me so try this and
see if it helps. I don't think you should have to but...
Regards,
Brendan.
-
4. Re: columnsWidth official support in RF 4.x
strannik Aug 31, 2012 4:11 PM (in response to healeyb)Brendan, can you please post your example?
I've simplified my usecase and specified width for both columns but width is still not applied ....
<rich:dataTable value="#{products}" var="product" style="width:100%"> <rich:column width="200px"> <h:outputText value="#{product.name}" /> </rich:column> <rich:column width="200px"> <h:graphicImage url="/resources/images/edit.gif" alt="Edit" /> </rich:column> </rich:dataTable> -
5. Re: columnsWidth official support in RF 4.x
healeyb Aug 31, 2012 7:35 PM (in response to strannik)Hi Sergey, I just use rich:column width="nnnpx" all the way through. Try removing the style="width: 100%". I have to admit
that mostly I'm using extendedDataTable but I have successfully used this on dataTable. What is the outer container of the
dataTable, what is the display: css value? for example if you use display: inline-block the table won't take up the full
container width.
Regards,
Brendan.
-
6. Re: columnsWidth official support in RF 4.x
strannik Sep 1, 2012 6:58 AM (in response to healeyb)Hi, Brendan.
Unfortunately I cannot remove style="width:100%" because I want that my table was the same width as its container.
I deployed and changed a bit showcase application(Data Table Sorting sample). Here it is(changed version)
<h:form> <rich:dataTable value="#{capitalsBean.capitals}" var="cap" id="table" style="width:100%"> <rich:column width="50px"> <f:facet name="header"> State Flag </f:facet> <h:graphicImage value="#{cap.stateFlag}" alt="flag" /> </rich:column> <rich:column sortBy="#{cap.name}" id="name" sortOrder="#{capitalsSortingBean.capitalsOrder}"> <f:facet name="header"> <a4j:commandLink value="Sort by Capital Name" render="table" action="#{capitalsSortingBean.sortByCapitals}" /> </f:facet> <h:outputText value="#{cap.name}" /> </rich:column> </rich:dataTable> </h:form> Unfortunately the column width hasn't changed.
There are two ways to change this behavior:
1) Use columnsWidth="50px," for the whole table
2) Use style="width:50px" for the specified column.
So it seems like width attribute is still not applied.