Hi Ugo:

Do you tried the 2.1.8-dev branch? I remember to have a similar problem few months ago, but I am not sure if this is exactly what are you looking for.

Best Regards,

Antonio Gallardo.

Ugo Cei wrote:

Let's assume I have a Person class:

public class Person {
  public String getFirstname();
  public String getLastname();
  public Address getAddress();
  ...
}

and an Address class:

public class Address {
  public String getStreet();
  public String getTown();
  ...
}

I am building a form interface for editing a Person, with this binding:

<fb:value id="street" path="address/street"/>

Now, when trying to save the form, JXPath will do a jxpathContext.createPathAndSetValue which will fail because person.getAddress() is null and the JXPath context doesn't know how to create an Address.

I could work around this problem by making sure person.address is not null before loading it into the form, but I don't like this solution. A better option, maybe, would be setting a factory on the context, like is shown here: http://jakarta.apache.org/commons/jxpath/users- guide.html#Creating%20Objects

My problem is: where do I set this factory in CForms, assuming this is possible at all?

    Thanks in Advance,

        Ugo


Reply via email to