You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ruben Pardo <ru...@yahoo.es> on 2003/12/05 19:07:36 UTC

dynamic generation of select fields problem

Hi everybody!

  This is my problem, i've to generate a variable
quantity of select fields. The solution i thougth was
a map backed form, that dynamically generate the names
of this fields with JSTL, something like this:

<c:forEach  items="${sessionScope}" var ="farmacia"
varStatus="st">
 .....
  <html-el:select property="value(campos${st.count})">
   ..............
   ..............
  </html:select>
....

</c:forEach> 

but qhen i try to run this, i've got an
NullPointerException saying me that no getter for
property value(campo1) ...

I don't know what could be the problem, or how i can
solve in other way.

Thanks a lot and any type of help could be aprecciated.

_______________________________________________________________
Yahoo! Sorteos
¡Ya puedes comprar Lotería de Navidad!
http://yahoo.ventura24.es/

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


Re: dynamic generation of select fields problem

Posted by "java@pmbr" <ja...@pmbr.net>.
Ruben,

    I guess that you can't access a property using a sintax of function in:

        <html-el:select property="value(campos${st.count})">

    Maybe you need to use the sintax of array:

        <html-el:select property="value[campos${st.count}]">

    Certo?

Paulo Marcio

----- Original Message ----- 
From: "Ruben Pardo" <ru...@yahoo.es>
To: <st...@jakarta.apache.org>
Sent: Friday, December 05, 2003 4:07 PM
Subject: dynamic generation of select fields problem


> Hi everybody!
> 
>   This is my problem, i've to generate a variable
> quantity of select fields. The solution i thougth was
> a map backed form, that dynamically generate the names
> of this fields with JSTL, something like this:
> 
> <c:forEach  items="${sessionScope}" var ="farmacia"
> varStatus="st">
>  .....
>   <html-el:select property="value(campos${st.count})">
>    ..............
>    ..............
>   </html:select>
> ....
> 
> </c:forEach> 
> 
> but qhen i try to run this, i've got an
> NullPointerException saying me that no getter for
> property value(campo1) ...
> 
> I don't know what could be the problem, or how i can
> solve in other way.
> 
> Thanks a lot and any type of help could be aprecciated.

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