ActionForm not being updated. Please advice.
Hi, I am trying to get that iterate tag to work. I am interating through a vector a displaying the results. I have one field that I want the user to update hence I have made it a text box. When the page displays, the data is correct but when the user enters something into the text box and hits submit, the form in the actionservlet has the old data not what the user has entered. My jsp is as follows: html:form action=viRFQBid.do logic:iterate id=item name=ItemBidForm property=itemList TR TD CLASS=TD_Border bean:write name=item property=number / /TD TD CLASS=TD_Border html:textarea name=item property=partDescription / /TD TD CLASS=TD_Border html:text name=item property=unitPrice indexed=true / /TD /TR /logic:iterate /html:form Anything the user enters in the unit price is ignored, the old value is present in the form. My Struts config is: form-beans type=org.apache.struts.action.ActionFormBean form-bean name=ItemBidForm type=com.popware.rd.viPro.form.ItemBidForm/ /form-beans action-mappings actionpath=/viRFQSummary type=com.popware.rd.viPro.action.viRFQSummaryAction name=ItemBidForm input=/pwRFQList.jsp forward name=successpath=/pwRFQBid.jsp/ /action !-- Process the rfqBid action -- actionpath=/viRFQBid type=com.popware.rd.viPro.action.viRFQBidAction name=ItemBidForm input=/pwRFQList.jsp forward name=successpath=/pwRFQBidResponse.jsp/ /action /action-mappings viRFQSummaryAction works, the form is populated and passed to pwRFQBid.jsp but whatever the user enters as a unit cost is ignored. I take the form out in viRFQBidAction and check it. Any help in figuring this out is appreciated. Alex
Re: ActionForm not being updated. Please advice.
Alex Colic [EMAIL PROTECTED] wrote: I am interating through a vector a displaying the results. I have one field that I want the user to update hence I have made it a text box. When the page displays, the data is correct but when the user enters something into the text box and hits submit, the form in the actionservlet has the old data not what the user has entered. This is because the generated HTML does not contain the index. Try the indexed attribute of html:text (it is not in the release version 1.0) Or try this: html:text property='%= attribute[ + i + ].value %' / Note: your ActionForm has to be able to handle setAttribute(i, ...) even when the underlaying vector is empty. -- gR
Re: ActionForm not being updated. Please advice.
You will need to use Indexed To Tags developed by Dave which is not part of Struts 1.0. I have tested it--It works !!! http://husted.com/about/struts/indexed-tags.htm From: Alex Colic [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: Struts [EMAIL PROTECTED] Subject: ActionForm not being updated. Please advice. Date: Tue, 14 Aug 2001 11:28:01 -0400 Hi, I am trying to get that iterate tag to work. I am interating through a vector a displaying the results. I have one field that I want the user to update hence I have made it a text box. When the page displays, the data is correct but when the user enters something into the text box and hits submit, the form in the actionservlet has the old data not what the user has entered. My jsp is as follows: html:form action=viRFQBid.do logic:iterate id=item name=ItemBidForm property=itemList TR TD CLASS=TD_Border bean:write name=item property=number / /TD TD CLASS=TD_Border html:textarea name=item property=partDescription / /TD TD CLASS=TD_Border html:text name=item property=unitPrice indexed=true / /TD /TR /logic:iterate /html:form Anything the user enters in the unit price is ignored, the old value is present in the form. My Struts config is: form-beans type=org.apache.struts.action.ActionFormBean form-bean name=ItemBidForm type=com.popware.rd.viPro.form.ItemBidForm/ /form-beans action-mappings actionpath=/viRFQSummary type=com.popware.rd.viPro.action.viRFQSummaryAction name=ItemBidForm input=/pwRFQList.jsp forward name=successpath=/pwRFQBid.jsp/ /action !-- Process the rfqBid action -- actionpath=/viRFQBid type=com.popware.rd.viPro.action.viRFQBidAction name=ItemBidForm input=/pwRFQList.jsp forward name=successpath=/pwRFQBidResponse.jsp/ /action /action-mappings viRFQSummaryAction works, the form is populated and passed to pwRFQBid.jsp but whatever the user enters as a unit cost is ignored. I take the form out in viRFQBidAction and check it. Any help in figuring this out is appreciated. Alex _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp