Return-Path: Delivered-To: apmail-struts-user-archive@www.apache.org Received: (qmail 65309 invoked from network); 6 Apr 2004 17:00:01 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 6 Apr 2004 17:00:01 -0000 Received: (qmail 40337 invoked by uid 500); 6 Apr 2004 16:59:27 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 40323 invoked by uid 500); 6 Apr 2004 16:59:27 -0000 Mailing-List: contact user-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list user@struts.apache.org Received: (qmail 40308 invoked from network); 6 Apr 2004 16:59:27 -0000 Received: from unknown (HELO moutng.kundenserver.de) (212.227.126.187) by daedalus.apache.org with SMTP; 6 Apr 2004 16:59:27 -0000 Received: from [212.227.126.162] (helo=mrelayng.kundenserver.de) by moutng.kundenserver.de with esmtp (Exim 3.35 #1) id 1BAtv8-00051R-00 for user@struts.apache.org; Tue, 06 Apr 2004 18:59:30 +0200 Received: from [80.128.30.75] (helo=cyberspaceroad.com) by mrelayng.kundenserver.de with asmtp (Exim 3.35 #1) id 1BAtv8-0007mf-00 for user@struts.apache.org; Tue, 06 Apr 2004 18:59:30 +0200 Message-ID: <4072E182.3060004@cyberspaceroad.com> Date: Tue, 06 Apr 2004 18:57:38 +0200 From: Adam Hardy User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031021 X-Accept-Language: de MIME-Version: 1.0 To: Struts Users Mailing List Subject: Re: Question about logic:iterator, indexId and hidden fields References: <26439701CF1FE441B8EC1A2ADC7E87EE17843E@neptune.usdataworks.com> <4072DE4F.30501@cyberspaceroad.com> In-Reply-To: <4072DE4F.30501@cyberspaceroad.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: kundenserver.de abuse@kundenserver.de auth:7be52423742ce504c1b541fa1f258887 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Actually you might need a name attribute on that hidden field as well ... which could get complicated. It depends on where you form is. Inside or outside the logic:iterate? On 04/06/2004 06:43 PM Adam Hardy wrote: > This is pseudo-code, so before use it'll need corrections! For JSP2 & JSTL > > > "/> > > > > On 04/06/2004 06:30 PM Eric Hodges wrote: > >> Does anyone know of a simple way to send a logic:iterate's indexId >> back as a >> form bean property on submit? >> >> >> -----Original Message----- >> From: Eric Hodges Sent: Friday, April 02, 2004 7:24 AM >> To: Struts Users Mailing List >> Subject: RE: Question about logic:iterator, indexId and hidden fields >> >> >> I mean when the page is compiled, the tag is converted >> to an >> tag before the <%=index%> tag produces Java code. >> >> I think the taglib directive *is* incorrect whenever I get the <%=index%> >> tag to produce Java code, that's why it leaves in the >> HTML >> output. When I remove the <%=index%> tag, or when I include it in such a >> way that it doesn't generate Java code, the tag is >> recognized. >> >> What I want to do is write a tag that passes the value of >> Integer "index" to a Javascript function in its "onClick" function. >> >> >> >> -----Original Message----- >> From: Karr, David [mailto:David.Karr@wamu.net] >> Sent: Thursday, April 01, 2004 8:02 AM >> To: Struts Users Mailing List >> Subject: RE: Question about logic:iterator, indexId and hidden fields >> >> >> I think we're having trouble understanding what you're doing. In >> particular, you say that "the tag is evaluated before >> the <%=index%> tag". What do you mean by that? Then, you are now >> saying that after fixing your scriptlet expression reference, you say >> that the " tag isn't replaced with an tag". Do >> you mean that in the HTML output, you see "" instead >> of ""? If you're really seeing "" in the >> HTML output, then this would indicate that your taglib directive is >> incorrect or not present. >> >> >>> -----Original Message----- >>> From: Eric Hodges [mailto:EHodges@USDataworks.com] Sent: Thursday, >>> April 01, 2004 6:30 AM >>> To: user@struts.apache.org >>> Subject: RE: Question about logic:iterator, indexId and hidden fields >>> >>> >>> Thanks for the suggestion, but that doesn't work either. The >>> tag isn't replaced with an tag when I use the >>> syntax >>> you suggest. I've tried many variations on these syntaxes. If the JSP >>> expression get's parsed, the struts tags aren't understood. If the >>> struts >>> tags are understood the JSP expression isn't parsed. >>> >>> Any other ideas? Surely this is a common usage pattern. >>> >>> -----Original Message----- >>> From: Martin Cooper [mailto:martinc@apache.org] >>> Sent: Wednesday, March 31, 2004 10:46 AM >>> To: user@struts.apache.org >>> Subject: Re: Question about logic:iterator, indexId and hidden fields >>> >>> >>> >>> "Eric Hodges" wrote in message >>> news:26439701CF1FE441B8EC1A2ADC7E87EE17843A@neptune.usdataworks.com... >>> >>>> I have a form with a list of elements on it. Each element >>> >>> >>> has an "Edit" >>> >>>> button associated with it. When the user clicks the Edit >>> >>> >>> button for a >>> >>>> specific element, I want to send back the value of indexId >>> >>> >>> in a hidden >>> field >>> >>>> on the form. I can't figure out a clean way to do this. The >>> >>> >>> documentation >>> >>>> says "indexId" will create a bean, but it really creates an >>> >>> >>> Integer (which >>> >>>> isn't a JavaBean). I've tried passing my indexId to a >>> >>> >>> Javascript function >>> >>>> that sets the form's hidden field sort of like this: >>>> >>>> >>> onclick="setEditIndex(<%=index%>)"/> >>>> >>>> but the tag is evaluated before the <%=index%> tag >>> >>> >>> The problem is that you have illegal JSP syntax for the 'onclick' >>> attribute. >>> The attribute value must be a string literal or a scripting >>> expression. You >>> cannot mix the two. Try this instead: >>> >>> onclick='<%= "setEditIndex(" + index + ")" %>' >>> >>> -- >>> Martin Cooper >>> >>> >>> >>>> >>>> Right now I've got some ugly JSP code that outputs the >>> >>> >>> submit element that >>> >>>> calls the Javascript function that sets the hidden field. >>> >>> >>> There must be a >>> >>>> simpler way. Any ideas? >>> >>> >>> >>> >>> >>> --------------------------------------------------------------------- >>> 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 >> >> > > -- struts 1.2 + tomcat 5.0.19 + java 1.4.2 Linux 2.4.20 Debian --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional commands, e-mail: user-help@struts.apache.org