The single & double quotes simply keep the parsing of the JSP straight.  The onclick 
value definition terminates at the first matching quote character.  

  onclick="<%="foo"+"bar"%>"
              ^
whoops!  onclick ends here.

So, since you are forced to use double-quotes (") within the scriptlet, you use a 
single-quote (') to wrap it all up.

  onclick='<%=lots of java with double quotes%>'

Sri

-----Original Message-----
From: Zeitlin, Mike [mailto:ZeitlinM@;daugherty.com] 
Sent: Wednesday, October 23, 2002 2:36 PM
To: 'Struts Users Mailing List'
Subject: RE: nested:text not being evaluated


Sri,

   Thanks, that worked!  Any explanation on what the difference is between using 
single and double quotes?

Mike

-----Original Message-----
From: Sri Sankaran [mailto:Sri.Sankaran@;sas.com]
Sent: Wednesday, October 23, 2002 2:29 PM
To: Struts Users Mailing List
Subject: RE: nested:text not being evaluated


Try deriving the entire string that represents your onclick attribute value form a 
scriptlet (note the user of single and double quotes):

onclick='<%="showTable("+pageContext.getAttribute("rowIndex")+","+pageContex
t.getAttribute("columnIndex")+")"%>'

Note: In addition I have taken the liberty to add a comma (,) to your JavaScript call. 
 I think that's what you meant.

Sri

-----Original Message-----
From: Zeitlin, Mike [mailto:ZeitlinM@;daugherty.com] 
Sent: Wednesday, October 23, 2002 2:18 PM
To: '[EMAIL PROTECTED]'
Subject: nested:text not being evaluated



I am trying to dynamically set the input parameters for a javascript method in an 
nested tag.  This is the code I am current using:

<nested:text property="displayValue" size="6" 
onclick="showTable(<%=pageContext.getAttribute("rowIndex")%><%=pageContext.g
etAttribute("columnIndex")%>);"/>

This does not generate the appropriate input tag.  But,  if I remove the onclick 
parameter,  the nested tag gets evaluated to an input tag jus t fine.  What am I doing 
wrong?

Any help would be appreciated,
Mike Zeitlin
Daugherty Systems

--
To unsubscribe, e-mail: <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>


--
To unsubscribe, e-mail: <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>

--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>

Reply via email to