Hi,
I have Scaffolded Spring MVC application using MyEclipse for Spring 9. The Scaffold application works well.
Now, i am customizing it as per my needs and i am required to add single value select combo box and multipule value select combo box. I have been successful in getting both the combos using following code.
<form:select id="business_org" path="organization.orgId" size="1" cssStyle="width:300px;" >
<form:option value="-1" label="---- Please Select -----" />
<form:options items="${orgList}"/>
</form:select>
<form:select id="business_category" path="selectedCategories" multiple="true" cssStyle="width:200px;" >
<form:options items="${categoriesList}" itemValue="categoryId" itemLabel="name"/>
</form:select>
Now, i want to add client side validation to force user to select values. All other fields are validated properly using DOJO [i.e Spring.addDecoration… ] but i am not able to apply same for <form:select> element. I tried following …
<script type="text/javascript">Spring.addDecoration(new Spring.ElementDecoration({elementId : "business_org",widgetType : "dijit.form.Select",widgetAttrs : {promptMessage: "<fmt:message key="business.name.help"/>",required : true}})); </script>
but it is not working.
I searched on internet and searched spring documentation but it seems it has been documented properly.Any help in this regard would be greatly appreciated.
Thanks in advance,
Raj