> From: "Marc Lustig" <[EMAIL PROTECTED]>
>
> Hi,
>
> instead of typing
>
> #if (!$kundeanlegenGroup.PasswordValue.isValid())
> $kundeanlegenGroup.PasswordValue.Message<br>
> #end
> <input type="Text" name="$kundeanlegenGroup.PasswordValue.Key"
> value="$!kundeanlegenGroup.PasswordValue" size="20">
>
> in my template I'd like to pass $kundeanlegenGroup.PasswordValue to macro
> that looks like that:
>
> #macro (valTextFeld $bezeichnung $feld $size)
> <tr><td align="right">$bezeichnung</td><td>
> #if (!$feld.isValid())
> $feld.Message<br>
> #end
> <input type="Text" name="$feld.Key" value="$!feld" size="$size"></td></tr>
> #end
>
> But calling #valTextFeld("Name:" $kundeanlegenGroup.PasswordValue 20)
> doesn't work unfortunately.
>
> Is it not possible to pass an object to an Intake macro?
I think you really mean "Is it not possible to pass an object to a Velocity
macro?"
> If yes, how to do so?
Yes, you can pass objects to velocity macros - I highly recommend them (my
GlobalMacros.vm file is currently 1237 lines long!)
Your macro and the call look okay to me. Are you getting an error message
of some kind? Remember that if you are using GlobalMacros.vm the macros
here are only parsed when the servlet container loads unless you explicitly
parse the file using:
#parse("GlobalMacros.vm")
And even then there is the possibility (depending on where you put the
statement) that you might need to hit the above line of code a second time
before changes to the macro are apparent. If I am doing extensive macro
development I include the above parse statement in either the specific page
template I am working on or in my default layout if I am changing lots of
pages - but I only ever do this in development.
There are a few relevant properties in TR.props and velocity.log is a good
place to check for problems.
Cheers,
Scott
--
Scott Eade
Backstage Technologies Pty. Ltd.
http://www.backstagetech.com.au
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>