struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oleg Konovalov" <olegstr...@gmail.com>
Subject Re: [OT] Re: Passing value from Struts tag in JSP to Action class
Date Mon, 13 Aug 2007 02:12:37 GMT
As I mentioned in the original e-mail:

Have hidden field:
<html:hidden property="*rowId*" value="-1"/>

I have a bunch of rows [ArrayList of ValueObject Classes], and a button
corresponding to each row.
I populate the data from each row in forEach loop.
User is supposed to click on one of these buttons [selecting one row to
process],
and onClick event I need to pass the rowId of the to the new Action
["notify"] in Action class.
Sounds like a trivial task ?
I am just not sure how to implement that correctly in Struts, pretty new to
Struts.

Maybe I should use
<html:submit src=pic.gif onclick="form.action='action.do?command=notify'" *
value*="${list.rowId}">
instead of HTML <input type=image...> ?

Then how do I catch that rowId [now Submit Value] in Action class ?

TIA,
Oleg.



On 8/11/07, Frank W. Zammetti <fzlists@omnytex.com> wrote:
>
> What is rowId?  That's not a standard attribute of the <input> tag,
> hence the error makes sense I think, assuming it's being interpreted
> equivalent to this.rowId... also, value doesn't have any context here, I
> assume you mean to do this.value (which it may be interpreted as
> anyway), but maybe not... what are you actually trying to do?
>
> Frank
>
> --
> Frank W. Zammetti
> Founder and Chief Software Architect
> Omnytex Technologies
> http://www.omnytex.com
> AIM/Yahoo: fzammetti
> MSN: fzammetti@hotmail.com
> Author of "Practical Ajax Projects With Java Technology"
>   (2006, Apress, ISBN 1-59059-695-1)
> and "JavaScript, DOM Scripting and Ajax Projects"
>   (2007, Apress, ISBN 1-59059-816-4)
> Java Web Parts - http://javawebparts.sourceforge.net
>   Supplying the wheel, so you don't have to reinvent it!
>
> Oleg Konovalov wrote:
> > Dave,
> >
> > What am I doing wrong in that Javascript ?
> > Honestly, I don't see it.
> > Please help !
> >
> > Thank you,
> > Oleg.
> >
> >
> >
> > On 8/10/07, Dave Newton <newton.dave@yahoo.com> wrote:
> >> --- Oleg Konovalov <olegstruts@gmail.com> wrote:
> >>>        <input type="image" onclick="rowId=value;"
> >>> As of now I am getting Javascript error "Object
> >>> doesn't support this property or method",
> >> complaining
> >>> about *rowId=value;*
> >> The "onclick" attribute must have valid JavaScript.
> >>
> >> d.
> >>
> >>
> >>
> >>
> >>
> >>
> ____________________________________________________________________________________
> >> Take the Internet to Go: Yahoo!Go puts the Internet in your pocket:
> mail,
> >> news, photos & more.
> >> http://mobile.yahoo.com/go?refer=1GNXIC
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> For additional commands, e-mail: user-help@struts.apache.org
> >>
> >>
> >
> >
> > ------------------------------------------------------------------------
> >
> > No virus found in this incoming message.
> > Checked by AVG Free Edition.
> > Version: 7.5.476 / Virus Database: 269.11.13/946 - Release Date:
> 8/10/2007 3:50 PM
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message