struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@lexmark.com
Subject RE: onclick handler in the context of a struts iterate tag
Date Tue, 14 Aug 2001 21:11:41 GMT


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" <lmaturo%athensgroup.com@interlock.lexmark.com> on 08/14/2001
04:45:43 PM

Please respond to struts-user%jakarta.apache.org@interlock.lexmark.com; Please
      respond to lmaturo%athensgroup.com@interlock.lexmark.com

To:   struts-user%jakarta.apache.org@interlock.lexmark.com
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" <lmaturo%athensgroup.com@interlock.lexmark.com> on 08/14/2001
11:11:45 AM

Please respond to struts-user%jakarta.apache.org@interlock.lexmark.com;
Please
      respond to lmaturo%athensgroup.com@interlock.lexmark.com

To:   struts-user%jakarta.apache.org@interlock.lexmark.com
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















Mime
View raw message