CLONE -ClassCastException in CoercingPropertyConduitWrapper
-----------------------------------------------------------

                 Key: TAPESTRY-2633
                 URL: https://issues.apache.org/jira/browse/TAPESTRY-2633
             Project: Tapestry
          Issue Type: Bug
          Components: Core Components
    Affects Versions: 5.0.9
         Environment: Jetty & MacOS X 
            Reporter: Ben Dinnerville
            Assignee: Howard M. Lewis Ship


When a bean editor receives beans from differenct classes (superclass & 
subclass) sometimes the wrong fields are displayed and other times a 
ClassCastException is throws in the CoercingPropertyConduitWrapper.
This happens only, when bean editing is finished by the onSubmit method.

TestCase: 

TT1 is the superclasss of TT2

TT1.java
-------------------


public class TT1 {
        private String name;
        
        public String getName() {
                return name;
        }
        
        public void setName(String name) {
                this.name = name;
        }
}


TT2.java
----------------------------


public class TT2 extends TT1 {

        private String v2;

        public String getV2() {
                return v2;
        }

        public void setV2(String v2) {
                this.v2 = v2;
        }
}


CoercTest.java
-----------------------

public class CoercTest {

        @Persist
        private TT1 testObject;
        
        
        @OnEvent(component="typeTO1")
        public void onTypeTO1() {
                setTestObject(new TT1());
        }
        
        @OnEvent(component="typeTO2")
        public void onTypeTO2() {
                setTestObject(new TT2());               
        }

        public TT1 getTestObject() {
                return testObject;
        }

        public void setTestObject(TT1 testObject) {
                this.testObject = testObject;
        }
        
        public void onSubmit() {
                testObject = null;
        }
        
        public boolean isTestObjectNotNull() {
                return testObject != null;
        }
        
}


CoercTest.tml

<html  xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>
<body>
<t:ActionLink t:id="typeTO1">TT1</t:ActionLink><br/>
<t:ActionLink t:id="typeTO2">TT2</t:ActionLink><br/>
<t:If test="testObjectNotNull">
<t:BeanEditForm object="testObject"/>
</t:If>
</body>
</html>



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to