You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by jill han <jh...@bynum.com> on 2005/11/17 17:54:45 UTC

how to use a macro along with onClick

I tried to use a macro along with onClick. I expected the macro will be
called only after the image was clicked. However it did not turn out as
the way I expected.  There are scripting error. When I looked at the
source codes, onClick = ' <Table> ..... '

< a href='#' onClick = '#vlmacro($val $va2 $vaList)'>
  <img name='image' src='image.gif'></a>

Is there anyway to use a macro along with onClick?

Thanks in advance.

Jill


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: how to use a macro along with onClick

Posted by Barbara Baughman <ba...@utdallas.edu>.
If $val, $va2, and $vaList are in the Velocity context, it should
work.  If any of these are set in the Javascript, then Velocity will
not know about it at the time of evaulation, since the Javascript is
run by the client after Velocity is done.

Remember, Velocity only knows about Velocity context objects and
distributed jre objects.

Barbara Baughman
X2157

On Thu, 17 Nov 2005, jill han wrote:

> I tried to use a macro along with onClick. I expected the macro will be
> called only after the image was clicked. However it did not turn out as
> the way I expected.  There are scripting error. When I looked at the
> source codes, onClick = ' <Table> ..... '
>
> < a href='#' onClick = '#vlmacro($val $va2 $vaList)'>
>   <img name='image' src='image.gif'></a>
>
> Is there anyway to use a macro along with onClick?
>
> Thanks in advance.
>
> Jill
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: how to use a macro along with onClick

Posted by Mike Kienenberger <mk...@gmail.com>.
Velocity is server-side web page generation.  It generates the data
you see when you use "View Source".

What you want is to execute code client-side.   You'll need to write
javascript to execute code client-side.

On 11/17/05, jill han <jh...@bynum.com> wrote:
> I tried to use a macro along with onClick. I expected the macro will be
> called only after the image was clicked. However it did not turn out as
> the way I expected.  There are scripting error. When I looked at the
> source codes, onClick = ' <Table> ..... '
>
> < a href='#' onClick = '#vlmacro($val $va2 $vaList)'>
>   <img name='image' src='image.gif'></a>
>
> Is there anyway to use a macro along with onClick?
>
> Thanks in advance.
>
> Jill
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org