Subject: Undeliverable: Re: Nested dispatch action To: <[EMAIL PROTECTED]>
Your message
To: Struts Users Mailing List <[EMAIL PROTECTED]>@[EMAIL PROTECTED]; Struts Users Mailing List <[EMAIL PROTECTED]>@[EMAIL PROTECTED] Subject: Re: Nested dispatch action Sent: Sun, 27 Jun 2004 09:51:09 -0400
did not reach the following recipient(s):
Brian Husted on Sun, 27 Jun 2004 13:51:09 -0400 User Brian Husted/AMS/AMSINC (Brian Husted/AMS/[EMAIL PROTECTED]) not listed in public Name & Address Book
Original-Envelope-ID: c=us;a= ;p=AMS;l={52F5B406-3C-040627135157Z-31353 Reporting-MTA: dns; CARNEY.ams.com
Final-Recipient: RFC822; [EMAIL PROTECTED]
Action: failed
Status: 5.1.0
X-Display-Name: Brian Husted
MIME-Version: 1.0
Content-Type: text/plain;
charset="us-ascii"
Content-class: urn:content-classes:message
X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0
Subject: Re: Nested dispatch action
Date: Sun, 27 Jun 2004 09:51:09 -0400
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
Thread-Topic: Re: Nested dispatch action
Thread-Index: AcRcTfJdl3589VHLQUGlqrO4Nj9WAw==
From: "<[EMAIL PROTECTED]>@[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List <[EMAIL PROTECTED]>@[EMAIL PROTECTED]" <[EMAIL PROTECTED]>,
"Struts Users Mailing List <[EMAIL PROTECTED]>@[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
Danged if I can make out what it is you are trying to do, Mark. You say:
"The situation is that i need to add an item to the the levelOne object. But when submitting there's no way of grabbing the index and thus knowing which of the levelOne objects to add a new rows of nested object to."
This means, I gather, that you want to add a "course" to forEach iteration. Is that right? You might, for example, want to add "dessert"? Where is this being "added" in the sense of where the decision is being made. Is it the client using the form or the server making the form?
Others may clearly see what the question is. Sorry if it is obvious and I am just being thick headed.
Michael
At 04:15 AM 6/27/2004, Mark Lowe wrote: >The only means i've thought this could be possible would be to iterate >through the parameter names enumeration like this.. > >Enumeration parameterNames = request.getParameterNames(); >String parameter = mapping.getParameter(); > >while(parameterNames.hasMoreElements()) { > String paramName = parameterNames.nextElement(); > if(paramName.indexOf(parameter) != -1) { > // find the index using substring > nestedDispatchMethod([struts gubbins],parameter, index); > } >} > > >But given such forms are likely to have a lot of parameter names this >would seem a bit heavy going. > > > > >On 27 Jun 2004, at 12:42, Mark Lowe wrote: > >>I've been looking through the struts source with a view to trying to find >>a way of handling nested dispatch actions. >> >>Basically the problem is passing through an index or key to the >>getMethodName (MappedDispatchAction) or the getKeyMethodMap >>(LookupDispatchAction) and running a method based on that. >> >> >> >><html:form action="/foo.do"> >><c:forEach var="course" items="${menuForm.courses}" varStatus="firstIndex"> >> <c:forEach var="nestedLevel" items="${course.dishes}" >> varStatus="nestedIndex"> >> <html:text property="${courses[firstIndex.index]. >> dishes[nestedIndex.index]" /> >> <html:submit property="method" indexed="true"> >> .. >> >>The situation is that i need to add an item to the the levelOne object. >>But when submitting there's no way of grabbing the index and thus knowing >>which of the levelOne objects to add a new rows of nested object to. >> >>So far I've been using the unspecified method and searching the parameter >>names for a custom button name. So not really dispatching any thing. But >>If i wanted to go another level i would arrive at the same problem. >> >>So far it looks like adding a nestedDispatchMethod or >>indexedDispatchMethod which also passes the index through. >> >>Anyone else looked into this? It would seem a common enough problem. >> >>Mark >> >> >> >> >> >> >> >> >> >> >> >> >>--------------------------------------------------------------------- >>To unsubscribe, e-mail: [EMAIL PROTECTED] >>For additional commands, e-mail: [EMAIL PROTECTED] > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] > >
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]