Sure thing Freddy, actionBean:

        private List<Person> people;

        //called in default 'view' handler method so intial form is
populate with people data that   can be updated
        public void prepareView(){
                people = new ArrayList<Person>();
                people.add(new Person("tom","t...@orange.com"));
                people.add(new Person("harry","ha...@orange.com"));
                people.add(new Person("adrian","adr...@orange.com"));
                people.add(new Person("julie","ju...@orange.com"));
                people.add(new Person("sue","s...@orange.com"));
        }
        
        private List<Person> people;
        
        @ValidateNestedProperties ({
            @Validate(field="name", required=true, minlength=3,
maxlength=15, on="update"),
             @Validate(field="email", required=true
,mask="[\\w\\...@[\\w\\.]+\\.\\w+", on="update")
         })
        @HandlesEvent("update")
        public Resolution updatePeople(){
                logger.info("people updated :" + people);
                return new RedirectResolution(WelcomeActionBean.class,"view");
        }
        
        public List<Person> getPeople() {
                return people;
        }

        public void setPeople(List<Person> people) {
                this.people = people;
        }


JSP:

<stripes:form beanclass="com.orangehome.ui.action.admintools.ExampleActionBean"
method="POST">
   <c:forEach items="${actionBean.people}" var="person" varStatus="loop">
            <tr>
                <td><stripes:text name="people[${loop.index}].name"
value="${person.name}"/></td>
                <td><stripes:text name="people[${loop.index}].email"
  value="${person.email}"/></td>
            </tr>
            <c:set var="newIndex" value="${loop.index + 1}" scope="page"/>
  </c:forEach>
  <stripes:submit name="update" value="update"/>
  </stripes:form>


Stripes is falling over in PropertyExpressionEvaluation.java:652,
looks like it's trying to instantiate a primitive (the index) :

Class clazz = convertToClass(node.getValueType(), node);

            if (clazz.isArray()) {
                return Array.newInstance(clazz.getComponentType(), 0);
            }
            else if (clazz.isEnum()) {
                return clazz.getEnumConstants()[0];
            }
            else if (clazz.isInterface() ) {
                return ReflectUtil.getInterfaceInstance(clazz);
            }
            else {
                return clazz.newInstance();
            }

Cheers,
Phil


On Fri, Mar 5, 2010 at 3:07 PM, Freddy Daoud <xf2...@fastmail.fm> wrote:
> Hi Phil,
>
> - DefaultActionBeanPropertyBinder  - Running binding for property with
> - name: people[0].email
> - DefaultActionBeanPropertyBinder  - Converting 1 value(s) using
> - converter net.sourceforge.stripes.validation.StringTypeConverter
> - DefaultActionBeanPropertyBinder  - Could not bind property with name
> - [people[0].email] to bean of type: ExampleActionBean
> - net.sourceforge.stripes.util.bean.EvaluationException: Encountered an
> - exception while trying to create  a default instance for property '0'
> - in expression 'people[0].email'.
>
> Could you post the code for ExampleActionBean and the model class
> for the people property?
>
> Freddy
>
>
> ------------------------------------------------------------------------------
> Download Intel&#174; Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> Stripes-users mailing list
> Stripes-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/stripes-users
>

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to