struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anindito De" <anind...@infosys.com>
Subject RE: dynamically populating options in form
Date Thu, 20 Nov 2003 08:55:05 GMT
Is there someway we can do the same thing, without making a server call
on every change event of the first select control ? 
Again, we want to make minimal use of JavaScript. 

Thanks in advance

Anindito


-----Original Message-----
From: Nimish Chourey , Tidel Park - Chennai
[mailto:NimishC@msdc.hcltech.com] 
Sent: Thursday, November 06, 2003 5:43 PM
To: Struts Users Mailing List
Subject: RE: dynamically populating options in form


Something like Below ..

The "Onchange" event will trigger the Submission to another action which
then keeps the collection in request/session scope and select Box B is
then
populated ..See the code below ..




<script>
		function callAction(){
			document.forms[0].action =
"<%=request.getContextPath()%>/populateAction.do";
			document.forms[0].submit();
		}
<script>

		<html:select property="A" onchange="callAction();">
			<html:options collection="collection1"
name="Form"
property="value" labelProperty="label" />
	    </html:select>

		<html:select property="B" >
			<html:options collection="collection.areas"
name="Form"  property="value" labelProperty="label" />
	    </html:select>


-----Original Message-----
From: Andrew Hill [mailto:andrew.david.hill@gridnode.com] 
Sent: Thursday, November 06, 2003 4:39 PM
To: Struts Users Mailing List
Subject: RE: dynamically populating options in form


Well at the least you would probably want to use some javascript to
trigger
the submission of the form onchange of the first select so that you can
populate the second select based on the first's value over on the server
side and then redisplay the form.

To do it without any javascript you would need to use a second submit
button
to do this, which the user would need to click after having entered a
value
in the first field.

-----Original Message-----
From: Anindito De [mailto:anindito@infosys.com]
Sent: Thursday, 6 November 2003 19:00
To: struts-user@jakarta.apache.org
Subject: dynamically populating options in form


Hi,

We have two select boxes in an HTML form. Based on the option that the
user
selects in the first box and some other considerations, the contents in
the
second box get populated. Are there any reasonable means of doing this
in
struts with minimal use of JavaScript ?

Thanks in advance
Anindito

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


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

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


Mime
View raw message