You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Rodrigo Reyes <ro...@instaservi.com> on 2002/11/26 18:21:10 UTC

Sending values to a #parsed template...

Hi
    I am using the #parse directive and I need to pass some variables to the
template which is being parsed. The code I am using is:

#macro (FE_textline $element)
 #set($label = $element.getAttributeValue("label"))
 #set($description = $element.getAttributeValue("description"))
 #set($name = $element.getAttributeValue("name"))
 #set($value = $element.getAttributeValue("value"))
 #set($size = $element.getAttributeValue("size"))
 #set($maxlength = $element.getAttributeValue("maxlength"))
 #parse("$widgetsPath/FE_textline.html")
#end

    Still, the parsed template is not recognizing the variables. Am I doing
something wrong here? Thanx...

Rodrigo



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Sending values to a #parsed template...

Posted by Ch...@dlr.de.
Yup
Si SeƱor
Ja
Oui
Da

Rodrigo Reyes wrote:
> So, is the context shared between the father template and the parsed one?
> 
> Rodrigo
> 
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 
> 

-- 
:) Christoph Reck


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Sending values to a #parsed template...

Posted by Rodrigo Reyes <ro...@instaservi.com>.
So, is the context shared between the father template and the parsed one?

Rodrigo



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Sending values to a #parsed template...

Posted by Ch...@dlr.de.
Hola,

I suggest to take a look into the log. I guess that your $element is invalid...
Also try adding a debugging output with
   $element.class.name

I also suggest to try the #local directive from
http://cvs.apache.org/viewcvs/jakarta-velocity/whiteboard/geir/Local.java?rev=HEAD
See usage embedded below (but also note that Vel must be configured
to know that it exists).

Geir, could the local directive be extended to take an empty set, and
herewith forcing all new variables into a nested context?

Saludos,
Christoph

Rodrigo Reyes wrote:
> Hi
>     I am using the #parse directive and I need to pass some variables to the
> template which is being parsed. The code I am using is:
> 
> #macro (FE_textline $element)
    #local( $label $description $name $value $size $maxlength )
>  #set($label = $element.getAttributeValue("label"))
>  #set($description = $element.getAttributeValue("description"))
>  #set($name = $element.getAttributeValue("name"))
>  #set($value = $element.getAttributeValue("value"))
>  #set($size = $element.getAttributeValue("size"))
>  #set($maxlength = $element.getAttributeValue("maxlength"))
>  #parse("$widgetsPath/FE_textline.html")
    #end
> #end
> 
>     Still, the parsed template is not recognizing the variables. Am I doing
> something wrong here? Thanx...
> 
> Rodrigo

-- 
:) Christoph Reck


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>