You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Vivek Chauhan <si...@gmail.com> on 2005/07/14 08:15:02 UTC
How to pass index from iterator tag to JS
Hi,
How can I pass the index of the iterator<logic:iterator> tag to a Javascript
function.
I had used JSP scriptlet but tht wz not working..
vivek
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: How to pass index from iterator tag to JS
Posted by Vivek Chauhan <si...@gmail.com>.
Thanks Leon,
The problem is solved.. but still we had to use JSP scriptlets... but I dont
mind tht till I am using Struts tags...
"Leon Rosenberg" <st...@anotheria.net> wrote in message
news:1121326244.4538.73.camel@acqua.internal.friendscout24.de...
> ah ok:
>
> <html:checkbox name="someList" property="someStatus" indexed="true"
> onclick="<%="javascript: changeSomeCheckBox("+index+")"%>" />
>
> regards
> Leon
>
>
> On Thu, 2005-07-14 at 12:59 +0530, Vivek Chauhan wrote:
>> Ya.. Thnx for ur suggestion..
>> actually the problem is with struts only.... you can nest two struts
>> tags..
>> Wht I wz doing..
>> logic:iterate name="someForm" property="someList" id="someList"
>> indexId="index">
>>
>> <html:checkbox name="someList" property="someStatus" indexed="true"
>> onclick="javascript: changeSomeCheckBox(<bean:write name="index" />)" />
>>
>> </loigic:iterate>
>>
>> But this didnt work so Now I m using input type = "checkbox" tag....
>>
>> Is there a way to work only using Struts tags..without resorting to pure
>> HTML...
>>
>>
>>
>> Thanks,
>>
>> Vivek
>>
>> <html:checkbox onclick="foo(<bean:write name="index">)" />
>> "Leon Rosenberg" <st...@anotheria.net> wrote in message
>> news:1121325035.4538.65.camel@acqua.internal.friendscout24.de...
>> > <logic:iterate bla.... indexId="i">
>> > <a href="#" onClick="myFunctionCall('<bean:write name="i"/>')">....
>> > </a>
>> > </logic:iterate>
>> >
>> > just an example.
>> > regards
>> > Leon
>> >
>> > On Thu, 2005-07-14 at 11:45 +0530, Vivek Chauhan wrote:
>> >> Hi,
>> >>
>> >> How can I pass the index of the iterator<logic:iterator> tag to a
>> >> Javascript
>> >> function.
>> >> I had used JSP scriptlet but tht wz not working..
>> >> vivek
>> >>
>> >>
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> 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
>>
>>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: How to pass index from iterator tag to JS
Posted by Leon Rosenberg <st...@anotheria.net>.
ah ok:
<html:checkbox name="someList" property="someStatus" indexed="true"
onclick="<%="javascript: changeSomeCheckBox("+index+")"%>" />
regards
Leon
On Thu, 2005-07-14 at 12:59 +0530, Vivek Chauhan wrote:
> Ya.. Thnx for ur suggestion..
> actually the problem is with struts only.... you can nest two struts tags..
> Wht I wz doing..
> logic:iterate name="someForm" property="someList" id="someList"
> indexId="index">
>
> <html:checkbox name="someList" property="someStatus" indexed="true"
> onclick="javascript: changeSomeCheckBox(<bean:write name="index" />)" />
>
> </loigic:iterate>
>
> But this didnt work so Now I m using input type = "checkbox" tag....
>
> Is there a way to work only using Struts tags..without resorting to pure
> HTML...
>
>
>
> Thanks,
>
> Vivek
>
> <html:checkbox onclick="foo(<bean:write name="index">)" />
> "Leon Rosenberg" <st...@anotheria.net> wrote in message
> news:1121325035.4538.65.camel@acqua.internal.friendscout24.de...
> > <logic:iterate bla.... indexId="i">
> > <a href="#" onClick="myFunctionCall('<bean:write name="i"/>')">....
> > </a>
> > </logic:iterate>
> >
> > just an example.
> > regards
> > Leon
> >
> > On Thu, 2005-07-14 at 11:45 +0530, Vivek Chauhan wrote:
> >> Hi,
> >>
> >> How can I pass the index of the iterator<logic:iterator> tag to a
> >> Javascript
> >> function.
> >> I had used JSP scriptlet but tht wz not working..
> >> vivek
> >>
> >>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> 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
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: How to pass index from iterator tag to JS
Posted by Vivek Chauhan <si...@gmail.com>.
Ya.. Thnx for ur suggestion..
actually the problem is with struts only.... you can nest two struts tags..
Wht I wz doing..
logic:iterate name="someForm" property="someList" id="someList"
indexId="index">
<html:checkbox name="someList" property="someStatus" indexed="true"
onclick="javascript: changeSomeCheckBox(<bean:write name="index" />)" />
</loigic:iterate>
But this didnt work so Now I m using input type = "checkbox" tag....
Is there a way to work only using Struts tags..without resorting to pure
HTML...
Thanks,
Vivek
<html:checkbox onclick="foo(<bean:write name="index">)" />
"Leon Rosenberg" <st...@anotheria.net> wrote in message
news:1121325035.4538.65.camel@acqua.internal.friendscout24.de...
> <logic:iterate bla.... indexId="i">
> <a href="#" onClick="myFunctionCall('<bean:write name="i"/>')">....
> </a>
> </logic:iterate>
>
> just an example.
> regards
> Leon
>
> On Thu, 2005-07-14 at 11:45 +0530, Vivek Chauhan wrote:
>> Hi,
>>
>> How can I pass the index of the iterator<logic:iterator> tag to a
>> Javascript
>> function.
>> I had used JSP scriptlet but tht wz not working..
>> vivek
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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: How to pass index from iterator tag to JS
Posted by Leon Rosenberg <st...@anotheria.net>.
<logic:iterate bla.... indexId="i">
<a href="#" onClick="myFunctionCall('<bean:write name="i"/>')">....
</a>
</logic:iterate>
just an example.
regards
Leon
On Thu, 2005-07-14 at 11:45 +0530, Vivek Chauhan wrote:
> Hi,
>
> How can I pass the index of the iterator<logic:iterator> tag to a Javascript
> function.
> I had used JSP scriptlet but tht wz not working..
> vivek
>
>
>
>
> ---------------------------------------------------------------------
> 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