>>I've thought of hidden
>>fields, but I don't now they would help, since
>>I can't set them from an action class.

Hmm, perhaps I'm misunderstanding your point, but why couldn't you set them
from an action class?

Anyway, hidden fields are very useful because then you've exposed that piece
of data to the client and JavaScript can then sink its teeth into it, if
need be. :)

Chris

Christopher Assenza
Phone:  412.201.6026
Fax:     412.201.6060
Email:  [EMAIL PROTECTED]
ACCESSDATA
Moving Your Business from Point A to Point e.SM
http://www.accessdc.com/



-----Original Message-----
From: Larry Maturo [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 14, 2001 5:27 PM
To: [EMAIL PROTECTED]
Subject: RE: onclick handler in the context of a struts iterate tag


Hi Dave,

No, I'm not using the same form for all three
pages. p2 repeats once for each of n items.  I
have back and next buttons, and my action class
for p2 determines if I hit back on the first
item, or next on the last item, and does the
appropriate forwarding.  I've thought of hidden
fields, but I don't now they would help, since
I can't set them from an action class.

Currently my thought is to use a request parameter
from p1, a session attribute on p3, and on p2 check
to see if either is non-null, and use that one.  This
is an ugly solution, and I'm surprised struts doesn't
supply something more elegant for so common a
problem.

-- Larry


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 14, 2001 4:12 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: onclick handler in the context of a struts iterate tag




Larry,

Hi.  You are correct that you cannot access the session using Javascript.

Are you using the same form for all three pages?  If so, you could use a
hidden
field, and set it in p1, and then in the action from p3.  Presumably what
you
display in p2 depends on the value you pass - how/where do you do that
processing?

Cheers,

Dave





"Larry Maturo" <[EMAIL PROTECTED]> on 08/14/2001
04:45:43 PM

Please respond to [EMAIL PROTECTED];
Please
      respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:    (bcc: David Hay/Lex/Lexmark)
Subject:  RE: onclick handler in the context of a struts iterate tag



I'll be glad to supply more info.

I have 3 pages.  Call them p1, p2, and p3.  On p1 I have a link to
p2 that is in table, with each row having the same link, but a
different value to pass to p2.  On p3 I get to p2 via a forward
in my action class, based on what the user does.  The parameter
needed by p2 must somehow be passed to it, and this is where
my problem lies.

In the action class there is no request.setParameter method to call,
therefore, I can't use a request parameter to pass the value to
p2.  My thought was to pass it to p2, from the p3 action class,
via a request.getSession().setAttribute call.

This means that in p1 I must also set the parameter in a session
attribute.  I assumed I could do this using the onclick handler
of the html:link tag, where the parameter is from an iterate
tag.  I have yet figured out how to do this.  I have tried using
JavaScript, but I apparently don't have access to the session in
JavaScript.  I have tried using a scriptlet, but apparently the
onclick property of the html:link tag does not like scriptlets.

Any ideas on how to handle this?

-- Larry Maturo




Not sure I understand you - could you post some more info?

Not quite sure why you can't pass info in the link?  Do you want a hidden
field
instead?

Cheers,

Dave




"Larry Maturo" <[EMAIL PROTECTED]> on 08/14/2001
11:11:45 AM

Please respond to [EMAIL PROTECTED];
Please
      respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:    (bcc: David Hay/Lex/Lexmark)
Subject:  onclick handler in the context of a struts iterate tag



Sorry to have to ask this again, but I got
no response to my original question.  This
time I only asking about the most important
subset of the problem, so hopefully it will
get a response.

I have a table I fill using the iterate tag.
In the table I have a link that is generated
from the iterate tag data.

I need to pass data in the link without using
a parameter, since when I get to the target
page from an Action Class, instead of this
link, I can't set parameters.

As far as I can tell, that means I will have
to utilize the onclick handler to do the
work, and I will need to pass it, as a
parameter, something made available from
the iterate tag.  How does one do this?

-- Larry Maturo














Reply via email to