Hello all,

I am writing a jsp that retrieves a row of a table in my database and
allows the user to modify the fields using a form. For example, if I have
the following table in my database:

NAME  GENDER
John  Male
Ann   Female

and the following code in my action class

...
RowSetDynaClass rowSet = dao.getUserData("John");
request.setAttribute("rowSet", rowSet);
...

I would like to display in my jsp a form with a text field containing
"John" and a two radio buttons labelled "male" (selected) and "female", so
that these values can be modified, and a submit button to update the
database.

This is the piece of code of my jsp displaying the fields of the form:

<logic:iterate id="row" name="rowSet" property="rows">
  <logic:iterate id="col" name="cols">
    <tr>
      <td><bean:write name="col" property="name" /></td>
      <td><html:text property="<%=((DynaProperty)col).getName()%>"
size="30"

value="<%=((DynaBean)row).get(((DynaProperty)col).getName()).toString()%>"
/></td>
    </tr>
  </logic:iterate>
</logic:iterate>

However, this way all the fields must be the same type (text in this case)
and have the same attributes (i.e. same size). I would like to know if
there is any method to be able to choose the type of input field (text,
select, checkbox, radio) or the attributes (size, maxlength for text) for
each field of the database.

Any suggestions?

Thanks in advance,

Javier


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to