At 2:03 PM -0700 2002/06/13, Villegas, Courtney wrote:
>can I feed an action into Javascript?
>
>This is what my struts link would look like to forward to another page:
>       <html:link page="/reportNav.do?action=Load">
>
>and this is what my javascript looks like to open the new browser window
>       openWindow('reportDelivery', '/budsDev/jsp/reportDeliveryQP.jsp',1,
>350, 300)

well, if your JavaScript points directly to a JSP then you aren't 
really using Struts.  If the question is "how do I get Javascript to 
go to a Struts action,"  you need to use the <html:rewrite> tag

something like:
<bean:define id="Load" value="Load" />
openWindow('reportDelivery','<html:rewrite page="/reportNav.do" 
paramId="action" paramName="Load" />',1,350,300)

see 
<http://jakarta.apache.org/struts/userGuide/struts-html.html#rewrite>for 
the details.

BTW, would it make sense to add an optional "paramValue" attribute to 
the tags which do HTML rewriting?  It would basically take the String 
literal that is defined in <bean:define>  Seems like it would 
simplify a common case.  I can do it and provide the patch if no one 
objects, but I'm wondering if maybe it was left out for a reason?

Joe
-- 
--
* Joe Germuska    { [EMAIL PROTECTED] }
"It's pitiful, sometimes, if they've got it bad. Their eyes get 
glazed, they go white, their hands tremble.... As I watch them I 
often feel that a dope peddler is a gentleman compared with the man 
who sells records."
        --Sam Goody, 1956
tune in posse radio: <http://www.live365.com/stations/289268>

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

Reply via email to