Display resultset in ftl in an ordered manner

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Display resultset in ftl in an ordered manner

nashrul
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
Reply | Threaded
Open this post in threaded view
|

Re: Display resultset in ftl in an ordered manner

Jacques Le Roux
Administrator
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" <[hidden email]>

>
> 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.