Hi, Further to the below mail related to our application(JSF Portlet application), following are the required details:
JSP file:
<t:dataTable id="data" styleClass="standardTable"
headerClass="standardTable_Header"
footerClass="standardTable_Header"
rowClasses="standardTable_Row1,standardTable_Row2"
columnClasses="standardTable_Column" var="row"
value="#{pc_TestNewView.orderListData}" preserveDataModel="false"
newspaperColumns="#{pc_TestNewView.orderListSize}">
<t:columns value="#{pc_TestNewView.orderListData}" var="column">
<h:inputText value="#{row.orderNo}" rendered="#{row.orderNo eq
column.orderNo}"/>
<h:inputText value="#{row.productName}" rendered
="#{row.orderNo eq column.orderNo}"/>
<h:inputText value="#{row.price}" rendered="#{row.orderNo eq
column.orderNo}"/>
<h:inputText value="#{row.qty}" rendered="#{row.orderNo eq
column.orderNo}"/>
</t:columns>
</t:dataTable>
In the above JSP file, we are iterating the list of objects of type "Order" in
our example.
Java file (Backing bean):
private DataModel orderDataModel;
private static final ArrayList<Order> orderList = new ArrayList<Order>(Arrays.
asList(
new Order("A001", "Intel CPU", new BigDecimal(
"700.00"), new BigDecimal(1)),
new Order("A002", "Harddisk 10TB", new BigDecimal(
"500.00"), new BigDecimal(2)),
new Order("A003", "Dell Laptop", new BigDecimal(
"11600.00"), new BigDecimal(8)),
new Order("A004", "Samsung LCD", new BigDecimal(
"5200.00"), new BigDecimal(3)),
new Order("A005", "A4Tech Mouse", new BigDecimal(
"100.00"), new BigDecimal(10))));
public DataModel getOrderListData() {
if(null == orderDataModel) {
orderDataModel = new ListDataModel(getOrders());
}
return orderDataModel;
}
private List<Order> getOrders() {
return orderList;
}
public int getOrderListSize() {
return orderList.size();
}
Details:
In the above backing bean .java file, we have populated the listdatamodel with
the help of the arraylist(orderlist) as hardcoded above. Please note that we
have used 5 items in a list.
Also, we have tested with one, two and three items in a list. We have attached
the respective screenshots for your reference.
Please do the needful.
Thanks & Regards,
Arunagiri K
(See attached file: Data table with 1 list item.gif)(See attached file: Data
table with 2 list items.gif)(See attached file: Data table with 3 list
items.gif)(See attached file: Data table with 5 list items.gif)
Arunagiri Kaliappan
Chennai
Mailto:[email protected]
www.viterra.ca
This e-mail and any attachment(s) are confidential and may be privileged.
If you are not the intended recipient please notify me immediately by return
e-mail, delete this e-mail and do not copy, use or disclose it.
Mike Kienenberger
<[email protected]
> To
MyFaces Discussion
01/04/2012 11:37 AM <[email protected]>
cc
Arunagiri Kaliappan
<[email protected]>
Subject
Re: Clarification needed for Tomahawk
datatable tag
Can you describe how the output is different when the number is greater than 3
and when the number is less than 4?
On Tue, Jan 3, 2012 at 9:01 AM, Arunagiri Kaliappan <
[email protected]> wrote:
Hi,
In our project (Portal application with JSF 1.1) , we are in need of showing
the columns vertically and also the number of columns is dynamic in nature.
We are using Apache MyFaces Tomahawk library for the above mentioned
requirement.
We have used <t:datatable> and <t:columns> tags. We have used the same
datamodel (list datamodel which is made up of ArrayList which in turn contains
objects) for both datatable and columns tags value attribute. But, the columns
are displayed correctly only when the number of columns is 3 and above. For
the columns below 3, the display is not proper.
Can you please suggest as how to proceed further?
Please do the needful.
Thanks & Regards,
Arunagiri K
Arunagiri Kaliappan
Chennai
Mailto:[email protected]
www.viterra.ca
This e-mail and any attachment(s) are confidential and may be privileged.
If you are not the intended recipient please notify me immediately by return
e-mail, delete this e-mail and do not copy, use or disclose it.
<<inline: 15807588.gif>>
<<inline: graycol.gif>>
<<inline: pic28253.gif>>
<<inline: ecblank.gif>>

