myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Enrique Arizon Benito (JIRA)" <...@myfaces.apache.org>
Subject [jira] Created: (MYFACES-1447) @EmbeddedId/@Embeddable PK static inner class bug ?
Date Mon, 09 Oct 2006 15:20:19 GMT
@EmbeddedId/@Embeddable PK static inner class bug ?
---------------------------------------------------

                 Key: MYFACES-1447
                 URL: http://issues.apache.org/jira/browse/MYFACES-1447
             Project: MyFaces Core
          Issue Type: Bug
    Affects Versions: 1.1.4
         Environment: JDK 1.5.06
            Reporter: Enrique Arizon Benito


I'm trying a JSF code similar to:

<li>Number:<h:inputText value="#{contract.pk.number}" required="true" id="pk_number"
/></li>
<li>Alias:<h:inputText value="#{contract.pk.alias}" required="true" id="pk_alias"
/></li>

The contract bean looks like:

public class Contract implements Serializable {
    @EmbeddedId
    private Contract.PK pk;
    ...
    @Embeddable
    public static class PK implements Serializable {
        private String number;
        private String alias;
        ...
        public String getNumber() { return this.number; }
        public void setNumber(String sNumber) {...}
        public String getAlias() { return this.alias; }
        public void setAlias(String sAlias) {...}
    }
}        


 Whatever I input into my form a "conversion error" is returned since getPk() returns null.

 To solve the problem I have to explicetely initialize the pk member:

public class Contract implements Serializable {
    @EmbeddedId
    private Contract.PK pk = new Contract.PK();
    ...
}        

 

More info:
http://forum.java.sun.com/thread.jspa?threadID=774503&tstart=30

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message