struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roger Varley" <roger.var...@googlemail.com>
Subject Re: [S2] Newbie Passing S2 variables to javascript functions
Date Mon, 30 Apr 2007 11:24:53 GMT
> Without seeing the error and the JSP code that generated it, it's hard
> to tell you what's wrong. However, remember that Javascript runs on the
> client, after the page has been generated. View the page source to see
> what the syntax error is. In this case, it's probably the lack of quotes
> around the OGNL expression. It may also be that an in-line expression
> like that wont work.
>
> Here's a couple of suggestions to try:
>
>      ... onclick="enableField('%{#indexValue}')" ...
>      ... onclick="%{'enableField(\'' + #indexValue + '\')'}" ...
>      ... onclick="enableField('${indexValue}')" ...
>

I've tried all your suggested variations, but looking at the source,
all the expressions are passed as a string, there's no evaluation of
the expression. Which, now you've explained that Javascript executes
on the client makes sense. So the question becomes is it possible to
interact with the action stack in Javascript?

Regards
Roger

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


Mime
View raw message