Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Contents of one form on another one.  RSS feed

 
Pankaj Shet
Ranch Hand
Posts: 312
Java Scala Spring
  • Mark post as helpful
  • send pies
  • 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
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • 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?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65825
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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: 312
Java Scala Spring
  • Mark post as helpful
  • send pies
  • 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..
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!