cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Giacomo Pati <>
Subject RE: Checkboxes in JXForms - javascript OK, java NOT
Date Thu, 21 Aug 2003 15:18:47 GMT
On Thu, 21 Aug 2003, Chris Clark wrote:

> I think there may be a bug then...
> When I try to use a String array in my Java class, I get the following error:
> Exception trying to set value with xpath validchecks; Cannot modify property: elrsproto.FormBean.validchecks;
Cannot convert value of class java.lang.String to type class [Ljava.lang.String;; Cannot convert
class java.lang.String to class [Ljava.lang.String;
> That's why I tried to use just a straight String.  And it works, except that it only
gets the value of the first check.
> Whether I use the nodeset or not, I get the same behaviour.
> I did verify that I don't need to use the nodeset if I specify all of the controls ahead
of time in the form definition.  Thanks.
> For now my work-around is to use a javascript array object for the form and then copy
it into my Java class.  That works.  Odd.

Ok, let check:

We use a Java Bean that has a:

    private String [] m_roles;

which gets initialized with an array from a database and the array size
fits the numbers of item we've stored in the database (even a
'm_roles = new String[ 0 ]' works for us).

with setter/getter

    public void setRoless( String [] roles )
        m_roles = roles;
    public String [] getRoless(  )
        return m_roles;

and the form snipped we use look like:

    <xf:select ref="/roless" appearance="full">
      <jx:forEach var="role" items="${allRoles}">

Hope this helps.

Giacomo Pati
Otego AG, Switzerland -
Orixo, the XML business alliance -

View raw message