struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tom McCobb" <tmcc...@attglobal.net>
Subject RE: html:select onchange question
Date Wed, 19 May 2004 23:18:32 GMT
I got it.  The form bean referred to in the stmtDetail.do (DetailForm)is a
different one than where the selMtr property lives (HeaderForm), and I just
had to loop through a mapping that took me through the HeaderForm first.

-----Original Message-----
From: Tom McCobb [mailto:tmccobb@attglobal.net]
Sent: Wednesday, May 19, 2004 6:59 PM
To: user@struts.apache.org
Subject: html:select onchange question


I have read most of the archived messsages on this subject, and I am still
left with questions.  Here is my basic problem:  When I change the value of
the SELECT by selecting a new option, I expect the new value to be set in
the form bean.  I then want to be able to retrieve the value from the form
bean to pass as a parameter to a method in another action class.  I am doing
this instead of request.getParameter('xxx') just as a matter of preference
to keep everything in the form beans.  Here is the code from the jsp:

<html:form   action="stmtDetail.do?method=getStmtDetail"	>
			<html:select name="HeaderForm" property="selMtr" onchange="submit()">
			   <html:option value="0">Current Costs</html:option>
			   <html:optionsCollection name="HeaderForm" property="stmts"
				           			   label="fullDate"
				           			   value="batchNo" />
			</html:select>
</html:form>

>From the debug statements in my stmtDetail.do action class, where I call a
getSelMtr() on the appropriate form bean, no value is passed.  Apparently
the submit() just triggers the stmtDetail.do before the changed value gets
set in the HeaderForm???

So what is the solution?

T. McCobb


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message