You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Nadesan, Binu" <bn...@cincom.com> on 2004/10/25 19:34:42 UTC
TreeSet in Velocity
Hi,
How do I iterate through a Treeset Object in Velocity template?
Please review the snippet here for the Java code
Long LCampaignID;
Long LCampaignGroupID;
Iterator iter = m_sCampaignItems.iterator();
while (iter.hasNext())
{
oCampaignItem = (CampaignItem)iter.next();
LCampaignID = oCampaignItem.getCampaignID();
LCampaignGroupID = oCampaignItem.getCampaignGroupID();
m_vAllCampaignIDs.addElement(LCampaignID);
if (!m_vAllCampaignGroupIDs.contains(LCampaignGroupID))
m_vAllCampaignGroupIDs.addElement(LCampaignGroupID);
m_htCampaignItems.put(LCampaignID, oCampaignItem);
m_cbxCampaigns.addItem(oCampaignItem);
}
How Can I achieve the above behavior in Velocity macro?
Regards...
Binu Nadesan.
(513) 612-2206.
Re: TreeSet in Velocity
Posted by Shinobu Kawai <sh...@gmail.com>.
Hi Binu,
> How do I iterate through a Treeset Object in Velocity template?
>
> Please review the snippet here for the Java code
>
> Long LCampaignID;
> Long LCampaignGroupID;
> Iterator iter = m_sCampaignItems.iterator();
> while (iter.hasNext())
> {
> oCampaignItem = (CampaignItem)iter.next();
>
> LCampaignID = oCampaignItem.getCampaignID();
> LCampaignGroupID = oCampaignItem.getCampaignGroupID();
>
> m_vAllCampaignIDs.addElement(LCampaignID);
> if (!m_vAllCampaignGroupIDs.contains(LCampaignGroupID))
> m_vAllCampaignGroupIDs.addElement(LCampaignGroupID);
> m_htCampaignItems.put(LCampaignID, oCampaignItem);
> m_cbxCampaigns.addItem(oCampaignItem);
> }
>
> How Can I achieve the above behavior in Velocity macro?
Try asking in the user list. You'll have better chances of getting
answers there. :)
http://jakarta.apache.org/site/mail2.html#Velocity
http://www.mail-archive.com/velocity-user@jakarta.apache.org/
## You can subscribe by sending an empty mail to
velocity-user-subscribe@jakarta.apache.org
#*
Hint: read here
http://jakarta.apache.org/velocity/user-guide.html#Loops
*#
Best regards,
-- Shinobu Kawai
--
Shinobu Kawai <sh...@gmail.com>
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org