You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by nashrul <an...@yahoo.com> on 2007/08/25 08:17:15 UTC

Display resultset in ftl in an ordered manner

How can we retrieve record from table in display it in ftl in an ordered
manner ??
For example, I have sales level table and do the query to get sales level id
(say sales level A, B, C)
I want to display this in ftl in B, C, A order.
I try to insert sequnce_num (in number data type) column in sales level
table and sort out the list based on this column, but it doesn't work.
(I put this line on top of my ftl file):
<#assign salesLevelsList = delegator.findByAnd("SalesLevel",
Static["org.ofbiz.base.util.UtilMisc"].toMap("lob","A","channelCode","2","incentive",
"Y"), Static["org.ofbiz.base.util.UtilMisc"].toList("sequenceNum"))>
(trying to query SalesLevel table where lob='A' and channelCode='2' and
incentive='Y' order by sequence_num)
I have alson changed the salesLevel table definition in entitymodel.xml

Could someone give me advice ??
Thanks
Nashrul
-- 
View this message in context: http://www.nabble.com/Display-resultset-in-ftl-in-an-ordered-manner-tf4327019.html#a12323554
Sent from the OFBiz - User mailing list archive at Nabble.com.


Re: Display resultset in ftl in an ordered manner

Posted by Jacques Le Roux <ja...@les7arts.com>.
The recommended practice is to use bsh scripts to retrieve data and ftl templates to show them.

Did you try to retrieve the data in a bsh script, invert it there and then use <#list> in the ftl template ?

Jacques


De : "nashrul" <an...@yahoo.com>
> 
> How can we retrieve record from table in display it in ftl in an ordered
> manner ??
> For example, I have sales level table and do the query to get sales level id
> (say sales level A, B, C)
> I want to display this in ftl in B, C, A order.
> I try to insert sequnce_num (in number data type) column in sales level
> table and sort out the list based on this column, but it doesn't work.
> (I put this line on top of my ftl file):
> <#assign salesLevelsList = delegator.findByAnd("SalesLevel",
> Static["org.ofbiz.base.util.UtilMisc"].toMap("lob","A","channelCode","2","incentive",
> "Y"), Static["org.ofbiz.base.util.UtilMisc"].toList("sequenceNum"))>
> (trying to query SalesLevel table where lob='A' and channelCode='2' and
> incentive='Y' order by sequence_num)
> I have alson changed the salesLevel table definition in entitymodel.xml
> 
> Could someone give me advice ??
> Thanks
> Nashrul
> -- 
> View this message in context: http://www.nabble.com/Display-resultset-in-ftl-in-an-ordered-manner-tf4327019.html#a12323554
> Sent from the OFBiz - User mailing list archive at Nabble.com.