struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Karr, David" <david.k...@attws.com>
Subject RE: How does Struts handle arrays of fields?
Date Wed, 04 Dec 2002 19:37:38 GMT
If I'm seeing your problem correctly, you probably know by now that the
EL only references bean properties, except when it's referencing
collections :) .  It checks whether something is a collection before it
checks whether it is a bean, so creating a SUBCLASS of a collection
class and adding bean properties won't work.  You'll have to have a bean
class that has a collection property, AND a size property.  Try
restructuring your bean to deal with that and see how far you get.

> -----Original Message-----
> From: David Graham [mailto:dgraham1980@hotmail.com]
> 
> I have a set of hidden fields all named "deletedId" but with 
> different 
> values.  What type should this be in my ActionForm?  It works 
> if I have
> private String[] deletedId; and related accessor methods.
> 
> My problem is that I want to use the JSTL's EL to get the 
> size of this 
> array.  I tried ${myForm.deletedId.length} with no success so 
> I tried using 
> a custom Collection class with a getSize() method and 
> ${myForm.deletedId.size}.  So I have a
> public Collection getDeletedId() and a
> public void setDeletedId(String[] id) method.  Struts 
> apparently didn't like 
> that I was trying to trick it and doesn't refill the array 
> when there's an 
> error on the form.
> 
> Any suggestions?
> 
> Thanks,
> Dave
> 
> _________________________________________________________________
> Add photos to your messages with MSN 8. Get 2 months FREE*. 
> http://join.msn.com/?page=features/featuredemail
> 
> 
> --
> To unsubscribe, e-mail:   
<mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>

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


Mime
View raw message