struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Taylor, Jason" <jtay...@cobaltgroup.com>
Subject RE: indexed attribute for html tags
Date Wed, 25 Sep 2002 14:36:35 GMT
The documentation is not so clear on this.  Basically, what happens in the
case you cite is that a request parameter will be sent to the Action class
you're submitting the form to that would look like
"?id[34].propertyName=xxxx" if it were on a query string.  
If that doesn't make sense to you, you need to dig a bit deeper and figure
out how HTTP requests and responses work.  
If it does make sense, you can see for yourself what I'm talking about by
spitting out the parameters when your Action class is invoked by the
controller and when your JSP receives the request object back from the
backend.  Then you can see how all the info is passed back and forth.

-----Original Message-----
From: deepank [mailto:deepank@sasken.com]
Sent: Tuesday, September 24, 2002 9:40 PM
To: Struts Users Mailing List
Subject: indexed attribute for html tags


I would like to use indexed attribute for some html tags to handle dynamic
html input elements (the number of input elements in the form is not fixed)

i have read the struts user guide, but unable understand what this means.
This is given for almost all html input tags

 indexed  -  Valid only inside of logic:iterate tag. If true then name of
the html tag will be rendered as "id[34].propertyName". Number in brackets
will be generated for every iteration and taken from ancestor logic:iterate
tag. (RT EXPR) 

"WHAT DOES "id[34].propertyName" MEAN????

can somebody give me an example how to use this attribute. how will the
property of a form bean and its corresponding getter/setter method look like
if i want to use the indexed attribute.

for example i have this in my jsp

<logic:iterate id="reviewer" name="revFormTeamVO" property="reviewers" >
    <html:text indexed="true" property="mail_id_v" size="10" value="/></TD>
</logic:iterate>

i have the form bean property mail_id_v declared as

private String[] mail_id_v;

public String getMail_id_v(int index) {
      return this.mail_id_v[index];
  }

 public void setMail_id_v(int index, String mail_id_v) {
    this.mail_id_v[index] = mail_id_v;
 }
    
But this does not work, i get an error, "No getter method for property
"mail_id_v"

any help will be appreciated

Deepank

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