RE: Multiple pararmeters from multiple links

2002-06-08 Thread Duffey, Keven

Just a hunch, but using Page scope on your Hashmap bean may be the problem. Try 
request scope, or even session scope if necessary. Although I would think request 
scope should work.

 -Original Message-
 From: Mark Nichols [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, June 06, 2002 7:56 AM
 To: Struts User
 Subject: Multiple pararmeters from multiple links
 
 
 All -
 
 I have a JSP which displays multiple rows of data. Each row 
 starts with a
 link based on the first column of data. The subsequent action 
 class needs to
 be passed the first three column values as parameters, like so:
 
 /do/NameSearch/Details?id=123456?lastName=Smythe?firstName=Jon
 
 In reading the archives I have come up with this:
 
 [...snip...]
 
 !-- a bean to hold the id:name pair needed for the request 
 this page will
 submit --
 jsp:usebean id=parms class=java.util.HashMap scope=page /
 
 [...snip...]
 
  logic:iterate id=results name=nameSearchResults 
 scope=session
 type=dhs.vcm.vis.form.nameSearch.ResultsForm
   !-- %= results % --
   pg:item
 dhshtml:row oddColor=#cddbeb evenColor=#ff
 evenStyleClass=text oddStyleClass=text
  td bgcolor=FFnbsp;/td
  td
   !-- populate the HashMap --
   %
parms.put(id,request.getParameter(id)) ;
parms.put(lastName,request.getParameter(lastName)) ;
parms.put(firstName,request.getParameter(firstName)) ;
   %
   html:link page=/do/NameSearch/Details name=parms 
 scope=page
 !-- clientName is a combination of two other attributes, lastName 
 firstName --
bean:write name=results property=clientName/
   /html:link
  /td
  tdbean:write name=results property=address//td
  tdbean:write name=results property=city//td
  tdbean:write name=results property=state//td
  tdbean:write name=results property=clientBirthdate//td
  tdbean:write name=results property=ssn//td
 /dhshtml:row
/pg:item
   /logic:iterate
 
 [...snip...]
 
 
 However, when I compile this I get the following message:
 
 JavaCompile: parms cannot be resolved.
 
 How do I get the parms reference inside my iterate loop to resove?
 
 TIA,
 
 mark n.
 
 --
 To unsubscribe, e-mail:   
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: 
 mailto:[EMAIL PROTECTED]
 
 

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




RE: Multiple pararmeters from multiple links

2002-06-06 Thread Sri Sankaran


While I don't have an answer to your question, I have an alternative.

An alternate strategy would be to include a getParameters() method in the object you 
are iterating over.  This method should have access to the current values of the id, 
firstName and lastName.  It would return a Map containing the necessary parameters.  
Your html:link would then be:

html:link page=/do/NameSearch/Details 
   name=nameSearchResults 
   property=parameters/


Hope this helped.

Sri

-Original Message-
From: Mark Nichols [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 06, 2002 10:56 AM
To: Struts User
Subject: Multiple pararmeters from multiple links


All -

I have a JSP which displays multiple rows of data. Each row starts with a
link based on the first column of data. The subsequent action class needs to
be passed the first three column values as parameters, like so:

/do/NameSearch/Details?id=123456?lastName=Smythe?firstName=Jon

In reading the archives I have come up with this:

[...snip...]

!-- a bean to hold the id:name pair needed for the request this page will
submit --
jsp:usebean id=parms class=java.util.HashMap scope=page /

[...snip...]

 logic:iterate id=results name=nameSearchResults scope=session
type=dhs.vcm.vis.form.nameSearch.ResultsForm
  !-- %= results % --
  pg:item
dhshtml:row oddColor=#cddbeb evenColor=#ff
evenStyleClass=text oddStyleClass=text
 td bgcolor=FFnbsp;/td
 td
  !-- populate the HashMap --
  %
   parms.put(id,request.getParameter(id)) ;
   parms.put(lastName,request.getParameter(lastName)) ;
   parms.put(firstName,request.getParameter(firstName)) ;
  %
  html:link page=/do/NameSearch/Details name=parms scope=page
!-- clientName is a combination of two other attributes, lastName 
firstName --
   bean:write name=results property=clientName/
  /html:link
 /td
 tdbean:write name=results property=address//td
 tdbean:write name=results property=city//td
 tdbean:write name=results property=state//td
 tdbean:write name=results property=clientBirthdate//td
 tdbean:write name=results property=ssn//td
/dhshtml:row
   /pg:item
  /logic:iterate

[...snip...]


However, when I compile this I get the following message:

JavaCompile: parms cannot be resolved.

How do I get the parms reference inside my iterate loop to resove?

TIA,

mark n.

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

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




Re: Multiple pararmeters from multiple links

2002-06-06 Thread Mark Nichols


- Original Message -
From: Sri Sankaran [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Thursday, June 06, 2002 10:10 AM
Subject: RE: Multiple pararmeters from multiple links



 While I don't have an answer to your question, I have an alternative.

 An alternate strategy would be to include a getParameters() method in the
object you are iterating over.  This method should have access to the
current values of the id, firstName and lastName.  It would return a Map
containing the necessary parameters.  Your html:link would then be:

 html:link page=/do/NameSearch/Details
name=nameSearchResults
property=parameters/


Much nicer indeed! Thank you



 Hope this helped.


Yes it did!


mark n.

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