• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Contents of one form on another one.

 
Ranch Hand
Posts: 338
Scala Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello friends,
I have one jsp in which there are several fields for the user to enter they are address,city,state,country,pincode,tax(radiobuttons,VAT or CST),eccno,vatno,cstno.


the user will enter all these fields and click on submit button,
On click of this button,some of these fields namely, address,tax,eccno,vatno,cstno,should be displayed alongwith the record no. in the tabular format on the another jsp as the first record.

when user clicks back button to enter another record all the fields in that jsp shud become blank so that user will be able to enter another record.

it shud be added to that table as second record.now the table shud contain first record as well as second one.

i m not able to write the code for the same.
so its my humble request to write the code for the same.

thanks and regards,
-pankaj
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We won't write it for you but we'll be happy to help if you're willing to roll up your sleeves. What have you got so far?
 
Sheriff
Posts: 67752
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

it shud be added to that table

Please use real words when posting to the forums. Abbreviations such as "shud" in place of "should" only serve to make your posts more difficult to read and less likely to generate useful responses.

Please read this for more information.

thanks,
bear
JavaRanch sheriff
 
Pankaj Shet
Ranch Hand
Posts: 338
Scala Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
this is what i have done.

<jsp:useBean id = "DelActionForm" class="com.myapp.struts.DelActionForm"/>
<jsp:setProperty name= "DelActionForm" property="*"/>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Delivery Summary</title>
</head>
<body bgcolor="blue">

<h1>Delivery Summary</h1>
<html:form action="Del_Dest">
<table border="1" align="center">
<thead>
<tr>
<th><bean:message key="Del_Dest_Summary.Dest_Id" /></th>
<th><bean:message key="Del_Dest_Summary.Dest_Address" /></th>
<th><bean:message key="Del_Dest_Summary.Tax" /></th>
<th><bean:message key="Del_Dest_Summary.ECCNO" /></th>
<th><bean:message key="Del_Dest_Summary.VAT" /></th>
<th><bean:message key="Del_Dest_Summary.CST" /></th>
</tr>
</thead>
<%
int num=1;
List list=new ArrayList ();
list.add (new DelActionForm ());
Iterator iterator=list.iterator ();
while(iterator.hasNext ())
{
DelActionForm daf =(DelActionForm)iterator.next ();
%>
<tr>
<td><%=num%></td>
<td><jsp:getProperty name="DelActionForm" property="address"/></td>
<td><jsp:getProperty name="DelActionForm" property="tax"/></td>
<td><jsp:getProperty name="DelActionForm" property="eccno"/></td>
<td><jsp:getProperty name="DelActionForm" property="vatno"/></td>
<td><jsp:getProperty name="DelActionForm" property="cstno"/></td>
<td><html:submit value = "EDIT"/></td>
<td><html:submit value = "DELETE"/></td>
</tr>
<%
num++;

}
%>
<tr>
<td><html:submit value="ADD DESTINATION"/></td>
</tr>
</table>
</body>
</html:form>

after doing this i am able to retrive those fields only once as first destination in the arraylist.
after i retrieve them, if i want to add another destination i also have a button called ADD Destination on the form in which the arraylist is displayed.i will click on that button and go to that form where i can feed that data again.after i add that data the first record is getting replaced.
but actually i wanted to add the same as the second record and show both of them which is not happening..
 
My, my, aren't you a big fella. Here, have a tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic