You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Mario Ivankovits (JIRA)" <de...@myfaces.apache.org> on 2006/10/10 07:59:21 UTC

[jira] Commented: (MYFACES-1447) @EmbeddedId/@Embeddable PK static inner class bug ?

    [ http://issues.apache.org/jira/browse/MYFACES-1447?page=comments#action_12441058 ] 
            
Mario Ivankovits commented on MYFACES-1447:
-------------------------------------------

JSF will not initialize your unitialized members.

Discussions were that a custom VariableResolver/PropertyResolver might do the trick, but no one had the time/need to try this out.

> @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