> -----Original Message-----
> From: Troy Hart [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, August 15, 2002 12:12 PM
> To: Struts Users Mailing List
> Subject: Re: dynamically Passing values to Javascript function
> 
> 
> On Thu, 2002-08-15 at 12:58, Troy Hart wrote:
> > On Thu, 2002-08-15 at 12:37, Chandra Sekharan Bhaskaran wrote:
> > > I have submit button in the iterate tag
> > > I need to pass the parameter  <bean:write name="companionInfo"
> > > property="companionArticleNumber" />",this)
> > > to deletescript and it gives me parsing error.
> > > any one had worked on this pls let me know
> > > rgds
> > > C.Bhaskaran
> > >  
> > >  <html:submit property="delete" onclick="deletescript("<bean:write
> > > name="companionInfo" property="companionArticleNumber" />",this)"
> > > styleId="formbuttons" />
> > >       <bean:message
> > > key="labels.buttons.msmetadata.companion.deleteCompanion" />
> > >      </html:submit>
> > 
> > You can not embed the the <bean:write> tag inside 
> <html:submit> tag. The
> > following is one alternative:
> > 
> > <html:submit property="delete"
> > 
> onclick="deletescript('<%=companionInfo.getCompanionArticleNum
> ber()%>',this)" styleId="formbuttons">
> >   <bean:message
> >     key="labels.buttons.msmetadata.companion.deleteCompanion"/>
> > </html:submit>
> 
> It seems like I may have had trouble with something similar to this
> before (that is my proposed solution to your problem). If you find the
> same thing, you can also try the following:
> 
> <%
>   StringBuffer deleteSubmitOnClick = new 
> StringBuffer("deletescript('");
>   
> deleteSubmitOnClick.append(companionInfo.getCompanionArticleNumber());
>   deleteSubmitOnClick.append("', this)");
> %>
> <html:submit property="delete"
> onclick="<%=deleteSubmitOnClick.toString()%>" styleId="formbuttons">
>   <bean:message
>     key="labels.buttons.msmetadata.companion.deleteCompanion"/>
> </html:submit>
> 
> Or, I'm sure there are other ideas...

Gaah.  Things like this will be so much nicer when the functionality of the
JSTL expression engine is available in the Struts tag libraries.  Hopefully
I can get my pet "Struts-EL" contribution closer to completion in the very
near future.  It's too bad I have to work for a living, or I'd be further
along :) .

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

Reply via email to