Same way I need to create a table and all fields are editable when user
double clicks.
Irfan can you tell me how can we create a new row using java script?


-----Original Message-----
From: Irfan Shaikh [mailto:[EMAIL PROTECTED] 
Sent: Monday, December 19, 2005 1:12 PM
To: Struts Users Mailing List
Subject: Re: Implementation of new row functionality of HTML table in Struts

No, user can add has many row he needed before submit... I had just added
one row to handle this scenario... It should work for as many row user has
added...


On 12/19/05, atta-ur rehman <[EMAIL PROTECTED]> wrote:
>
> okay, so you're saying use can add only ONE row dynamically before submit?
> and that the newly added row's HTML code is:
>
> <tr>
>          <td><input type="checkbox" name="id" value="yes"></td>
>          <td><input type="text" name="customer[4].firstName"
> value="John"></td>
>          <td><input type="text" name="customer[4].lastName"
> value="Mark"></td>
>          <td><input type="text" name="customer[4].address" value="New
> York"></td>
>    </tr>  <!--This is the HTML of hardcoded row-->
>
>
> if that's the case, in your ActionForm's reset method, detect that user
> has
> added a new row, maybe thru request.getParameter("customer[?].firstName")
> where ? will be an integer 0..n where reuqest.getParameter would return
> null
> for n+1. once you've done that do a:
>
> Customer[] customers = new Customer[n];
> form.set("customer", customers);
>
> see if that helps.
>
> ATTA
>
>
> On 12/18/05, Irfan Shaikh <[EMAIL PROTECTED]> wrote:
> >
> > Once again Generated HTML :
> >
> > <form name="listTextForm" method="post"
> > action="/GenerateHTMLTable/listtext.do">
> >
> > <input type="submit" value="Submit">
> >         <br>
> >   <table width="30%" border="0">
> >   <colgroup>
> >
> >         <COL width="5">
> >         <COL width="30">
> >     <COL width="30">
> >     <COL width="35">
> >   </colgroup>
> >
> >           <!--Session Scope -->
> >
> >         <tr>
> >           <td><input type="checkbox" name="id" value="yes"></td>
> >           <td><input type="text" name="customer[0].firstName"
> > value="Irfan"></td>
> >
> >           <td><input type="text" name="customer[0].lastName"
> > value="Shaikh"></td>
> >           <td><input type="text" name="customer[0].address" value="New
> > Mumbai"></td>
> >     </tr>
> >
> >         <tr>
> >           <td><input type="checkbox" name="id" value="yes"></td>
> >           <td><input type="text" name="customer[1].firstName"
> > value="Maruf1212"></td>
> >           <td><input type="text" name="customer[1].lastName"
> > value="Dolani"></td>
> >           <td><input type="text" name="customer[1].address"
> > value="Mumbai"></td>
> >     </tr>
> >
> >         <tr>
> >           <td><input type="checkbox" name="id" value="yes"></td>
> >
> >           <td><input type="text" name="customer[2].firstName"
> > value="Azima121111"></td>
> >           <td><input type="text" name="customer[2].lastName"
> > value="Kacchi"></td>
> >           <td><input type="text" name="customer[2].address"
> > value="Pune"></td>
> >     </tr>
> >
> >         <tr>
> >           <td><input type="checkbox" name="id" value="yes"></td>
> >           <td><input type="text" name="customer[3].firstName"
> > value="Ruhi11133"></td>
> >           <td><input type="text" name="customer[3].lastName"
> > value="Khan"></td>
> >           <td><input type="text" name="customer[3].address"
> > value="Pune"></td>
> >     </tr>
> >
> >
> >         <tr>
> >           <td><input type="checkbox" name="id" value="yes"></td>
> >           <td><input type="text" name="customer[4].firstName"
> > value="John"></td>
> >           <td><input type="text" name="customer[4].lastName"
> > value="Mark"></td>
> >           <td><input type="text" name="customer[4].address" value="New
> > York"></td>
> >     </tr> (Hardcoded HTML row)
> >
> >   </table>
> >
> >
> > </form>
> >
> >
>
>

-- 
Greetings!

 


ICICI Infotech is now 3i Infotech.


The e-mail addresses of the company's employees have been changed to <existing 
name>@3i-infotech.com. You are requested to take note of this new e-mail ID and 
make use of the same in future

 
"This e-mail message may contain confidential, proprietary or legally 
privileged information. It should not be used by anyone who is not the original 
intended recipient. If you have erroneously received this message, please 
delete it immediately and notify the sender. The recipient acknowledges that 3i 
Infotech or its subsidiaries and associated companies, (collectively "3i 
Infotech"), are unable to exercise control or ensure or guarantee the integrity 
of/over the contents of the information contained in e-mail transmissions and 
further acknowledges that any views expressed in this message are those of the 
individual sender and no binding nature of the message shall be implied or 
assumed unless the sender does so expressly with due authority of 3i Infotech. 
Before opening any attachments please check them for viruses and defects."

Reply via email to