File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Struts Validator on map-backed Form properties? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts Validator on map-backed Form properties?" Watch "Struts Validator on map-backed Form properties?" New topic
Author

Struts Validator on map-backed Form properties?

P-A Rosenberg
Greenhorn

Joined: Sep 22, 2005
Posts: 15
Hi

I'm trying to achive Javascript based form validation using the Struts validator framework on a Form containing a Map.

I think I know how to validate this "server side" but is it possible to use the Validator framework for the purpose and generate a javascript popup?

Copy/paste from Form:
public class OrderResourceModifyForm extends ValidatorForm
{
private Map timeTypePrices;
public OrderResourceModifyForm()
{
this.timeTypePrices = new HashMap();
}

public void setTimeTypePrice(String key, Object value)
{
this.timeTypePrices.put(key, value);
}

public Object getTimeTypePrice(String key)
{
return this.timeTypePrices.get(key);
}
}


Copy/paste from JSP:
<c:forEach var="orderResourcePrice" items="${timeTypePriceList}">
<tr>
<td>
<html-el:text property="timeTypePrice(${orderResourcePrice.timetype.id})" value="${orderResourcePrice.pricePerHour}" />
</td>
</tr>
</c:forEach>


Please help me write the field entry in my validation.xml in order to validate the input stored in the map timeTypePrices!
The attempt below doesn't do the trick...

<form name="OrderResourceModifyForm">

<field
property="timeTypePrices"
indexedListProperty="timeTypePrices"
depends="required, float" >
<arg0 key="label.orderresource_add_edit.price_per_hour"/>
</field>

</form>

Any help is appreciated!
Regards
//P-A
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts Validator on map-backed Form properties?
 
Similar Threads
Retrieving radio selection & checkbox selection from a DynaForm
Problem in Client side validation using Struts
Problem in Client Side Validation using Struts
Struts validation not working
Validator framework