struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Newton <newton.d...@yahoo.com>
Subject Re: [OT] Re: Passing value from Struts tag in JSP to Action class
Date Mon, 13 Aug 2007 02:35:12 GMT
--- Oleg Konovalov <olegstruts@gmail.com> wrote:
> As I mentioned in the original e-mail:
> 
> Have hidden field:
> <html:hidden property="*rowId*" value="-1"/>

Yeah, but... that's a form value, not a JavaScript
variable. The "onclick" attribute expects valid
JavaScript.

> I have a bunch of rows and a button corresponding to

> each row.

If you just want a link with a row ID then just build
a URL with a rowId parameter; you can use an image as
a link if you want.

If you're dead-set on using an actual form then you
could either build a small form with the rowId as a
hidden element for each row or set the value of the
hidden rowId element.

You can't do that just by saying "rowId=blahBlah" you
have to access the DOM rowId form field object (using
Prototype or similar, something like:

$('rowId').value=blahBlah;

If you're not doing anything destructive I'd probably
just make a text or image link w/ the parameter in the
URL. If it's destructive then I'd put it behind a
form. That's just me, though; other people will chime
in with other ideas and methods.

d.



      ____________________________________________________________________________________
Fussy? Opinionated? Impossible to please? Perfect.  Join Yahoo!'s user panel and lay it on
us. http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message