You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jim Reynolds <ji...@gmail.com> on 2006/04/07 19:38:45 UTC
html:text tag, how to get javascript index
I have the following logic:iterate loop
<logic:iterate id="abc" type="ab" name="a" property="jj" indexId="index">
<html:hidden indexed="true" property="name" name="abc" />
<html:text name="abc" indexed="true" property="age"
onchange="updateStatus('NEED INDEX HERE');" />
</logic:iterate>
The loop is happy and creates nice names and indexed properties.
Problem is, when someone does an update on one of the slices (of the
indexed data), I need to know which one they clicked.
The line updateStatus('NEED INDEX HERE');" is where my problem is.
I have tried everything to get the index to print inside there with
single quotes for the javascript function. Does anyone know how to get
around this?
Thanks,
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: html:text tag, how to get javascript index
Posted by Craig McClanahan <cr...@apache.org>.
On 4/7/06, Rick Reumann <st...@reumann.net> wrote:
>
> Jim Reynolds wrote the following on 4/7/2006 2:27 PM:
> > PS, Isn't it just the JSP, JSTL that enables that snippet to work? Or
> > do I need a certain jar?
>
> Not sure what could be wrong. Tomcat 5 supports EL expressions ( ${}
> stuff ) by default. Paste the tag declarations you are using on the top
> of the page.
Don't forget to use a Servlet 2.4 compatible declaration on your
web.xmlfile, if you want EL evaluation to be turned on in the JSP
pages.
--
> Rick
> http://www.learntechnology.net
Craig
Re: html:text tag, how to get javascript index
Posted by Rick Reumann <st...@reumann.net>.
Jim Reynolds wrote the following on 4/7/2006 2:27 PM:
> PS, Isn't it just the JSP, JSTL that enables that snippet to work? Or
> do I need a certain jar?
Not sure what could be wrong. Tomcat 5 supports EL expressions ( ${}
stuff ) by default. Paste the tag declarations you are using on the top
of the page.
--
Rick
http://www.learntechnology.net
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: html:text tag, how to get javascript index
Posted by Jim Reynolds <ji...@gmail.com>.
PS, Isn't it just the JSP, JSTL that enables that snippet to work? Or
do I need a certain jar?
Maybe I am missing something.
On 4/7/06, Jim Reynolds <ji...@gmail.com> wrote:
> It is the later. I just checked my lib dir. Only using the latest
> struts jars and no struts-el jars even in there.
>
> Thanks,
>
>
>
> On 4/7/06, Rick Reumann <st...@reumann.net> wrote:
> > Jim Reynolds wrote the following on 4/7/2006 2:02 PM:
> > > Thanks Rick for the info.
> > >
> > > I am running Tomcat 5.5. But for some reason, it is still not happy.
> > > It just prints out the tag like in the page, and does no variable
> > > substitution.
> >
> > What do you mean by it prints out the tag like in the page? Are you at
> > least getting <html:text converted to <input name=".." when you view the
> > source code? (Wondering if maybe you forgot your html tag declaration?)
> >
> > Or are you saying you get <input name="age"
> > onchange="updateStatus('${index}');/>
> >
> > If it's the latter, are you sure you aren't using some old struts jars?
> > Make sure you aren't using the struts-el jars while working within
> > tomcat 5.x.
> >
> > --
> > Rick
> > http://www.learntechnology.net
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: html:text tag, how to get javascript index
Posted by Jim Reynolds <ji...@gmail.com>.
It is the later. I just checked my lib dir. Only using the latest
struts jars and no struts-el jars even in there.
Thanks,
On 4/7/06, Rick Reumann <st...@reumann.net> wrote:
> Jim Reynolds wrote the following on 4/7/2006 2:02 PM:
> > Thanks Rick for the info.
> >
> > I am running Tomcat 5.5. But for some reason, it is still not happy.
> > It just prints out the tag like in the page, and does no variable
> > substitution.
>
> What do you mean by it prints out the tag like in the page? Are you at
> least getting <html:text converted to <input name=".." when you view the
> source code? (Wondering if maybe you forgot your html tag declaration?)
>
> Or are you saying you get <input name="age"
> onchange="updateStatus('${index}');/>
>
> If it's the latter, are you sure you aren't using some old struts jars?
> Make sure you aren't using the struts-el jars while working within
> tomcat 5.x.
>
> --
> Rick
> http://www.learntechnology.net
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: html:text tag, how to get javascript index
Posted by Rick Reumann <st...@reumann.net>.
Jim Reynolds wrote the following on 4/7/2006 2:02 PM:
> Thanks Rick for the info.
>
> I am running Tomcat 5.5. But for some reason, it is still not happy.
> It just prints out the tag like in the page, and does no variable
> substitution.
What do you mean by it prints out the tag like in the page? Are you at
least getting <html:text converted to <input name=".." when you view the
source code? (Wondering if maybe you forgot your html tag declaration?)
Or are you saying you get <input name="age"
onchange="updateStatus('${index}');/>
If it's the latter, are you sure you aren't using some old struts jars?
Make sure you aren't using the struts-el jars while working within
tomcat 5.x.
--
Rick
http://www.learntechnology.net
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: html:text tag, how to get javascript index
Posted by Jim Reynolds <ji...@gmail.com>.
Thanks Rick for the info.
I am running Tomcat 5.5. But for some reason, it is still not happy.
It just prints out the tag like in the page, and does no variable
substitution.
On 4/7/06, Rick Reumann <st...@reumann.net> wrote:
> Jim Reynolds wrote the following on 4/7/2006 1:38 PM:
> > I have the following logic:iterate loop
> >
> > <logic:iterate id="abc" type="ab" name="a" property="jj" indexId="index">
> > <html:hidden indexed="true" property="name" name="abc" />
> > <html:text name="abc" indexed="true" property="age"
> > onchange="updateStatus('NEED INDEX HERE');" />
>
> Depends what servlet and jsp spec you are using. Are you using something
> like Tomcat 5.x? If so...
>
> onchange="updateStatus('${index}');" />
>
> --
> Rick
> http://www.learntechnology.net
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: html:text tag, how to get javascript index
Posted by Rick Reumann <st...@reumann.net>.
Jim Reynolds wrote the following on 4/7/2006 1:38 PM:
> I have the following logic:iterate loop
>
> <logic:iterate id="abc" type="ab" name="a" property="jj" indexId="index">
> <html:hidden indexed="true" property="name" name="abc" />
> <html:text name="abc" indexed="true" property="age"
> onchange="updateStatus('NEED INDEX HERE');" />
Depends what servlet and jsp spec you are using. Are you using something
like Tomcat 5.x? If so...
onchange="updateStatus('${index}');" />
--
Rick
http://www.learntechnology.net
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org