Keith Seim <[EMAIL PROTECTED]> writes:

Ask yourself if this is the scope of the templating language or a
programming language. If you come up with "programming language", move
the code to a pull tool as it was suggested by some others.

Velocity is a language to build templates from your internal data
representation. If you need to embed a programming language in your
templates, use PHP, Jython or JSPs. You have a fully fledged Java
programming environment at your fingertips to write the functionality
of your code. This is not the job of Velocity. :-)

        Regards
                Henning



>Hi Hughes

>On Thursday, June 26, 2003, at 02:01  PM, M. C. Hughes wrote:

>>
>> On Thu, 26 Jun 2003, Keith Seim wrote:
>>
>>> Anyone know if it's possible to do while loops in velocity templates?
>>
>> The #foreach directive is the only looping construct provided by 
>> velocity.
>> Can you describe what you are trying to do in more depth? There might 
>> be a
>> way of making it work for you without it being a (dirty) hack.
>>

>~> Most certainly.  I have a table "X" that has a foreign link column 
>"ParentX" (foreign-key-> XID).  While 
>$myXinstance.xrelatedbyParentX()!=null, I want to print out 
>X.description.  Currently I've hacked it into my screen (do the while 
>loop in the screen, and store a List in the context), but I'll likely 
>run into a similar situations frequently (this was the first time I used 
>a VM loop, and it came up right away).

>Thanks for your time.
>Keith


>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]

-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
[EMAIL PROTECTED]        +49 9131 50 654 0   http://www.intermeta.de/

Java, perl, Solaris, Linux, xSP Consulting, Web Services 
freelance consultant -- Jakarta Turbine Development  -- hero for hire

--- Quote of the week: "It is pointless to tell people anything when
you know that they won't process the message." --- Jonathan Revusky

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to