This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
creating html form dynamically using logic:iterate
Ann Anderson
Greenhorn
Joined: Dec 29, 2008
Posts: 7
posted
0
Hello
I am new to Struts. I have retrieved data dynamically in form of list in action class.Now I want to write each row in different html form with two submit buttons on each form on the same page. i.e I want to create dynamic <html:form> with dynamic <html:submit> on it with a row of data retrieved dynamically. Please someone help me out.
Thanks in advance
Regards Ann
Suman Mainam
Greenhorn
Joined: Apr 16, 2008
Posts: 5
posted
0
Ann, I strange to here about your post, tell me one thing wha is the neccessity to create dynamic forms with dynamic submit(), actually as for the struts we have seperate form for each jsp page, and by default we use that forname everywhere in that whole html.
anyways try with this code it may help you
<logic:iterate name="formBeanName" type="package root of formBeanName" property="args" id="id" indexId="indId">
<html:form action="/actionName">
// enter the required code here
</html:form>
</logic:iterate>
each form will have a seperate formName and submit
Cheers/
Suman
Ann Anderson
Greenhorn
Joined: Dec 29, 2008
Posts: 7
posted
0
Thanks Suman
I have tried the same code you have written below but my page was not displayed when I added the line
<html:form action="/actionName"> so I felt I was wrong somewhere. I will try again.
Below is the code.
I am using struts1.3.10
**********************************
This is my Action class
**********************************
public class ViewCelebrity extends Action {
public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)throws Exception{
List listLoginData = new ArrayList();
SessionFactory sessionFactory;
Session session;
Transaction transaction;
Configuration configuration;
Query query;