Normal behavior.  Tapestry builds a model (the BeanModel) to identify
the properties to edit. It does this based on the type of the
property, which is statically determined.  The original type of the
parent.child expression was Child.  When you changed the child
property to be type Object, Tapestry built a model for Object, which
as no properties.

You can, alternatively, use the BeanModelSource to build a model
object from Child.class, and pass that directly to the BeanEditor via
its model parameter.


On Tue, Sep 28, 2010 at 1:30 PM, Anton Mezerny <[email protected]> wrote:
> Hi!
>
> I have 2 classes:
> public static class Parent{
>        private String name;
>        private String description;
>        private Child child;
>
>        //getters and setters
>    }
>
>   public static class Child{
>        private String childName;
>        private String childDescr;
>        //getters and setters
>    }
>
> Everything renders fine, when I have the Parent object with the Child object
> nested in it, and I try to render this combination like here:
> <t:form>
> <t:beaneditor object="parent" add="child">
>    <t:parameter name="child">
>
>        <t:beaneditor object="parent.child"/>
>
>    </t:parameter>
> </t:beaneditor>
> </t:form>
>
> But if I change Parent class to:
>
>  public static class Parent{
>        private String name;
>        private String description;
>        private Object child; //changed to Object instead of Child
> //getters and setters
> }
>
> my nested child object doesn't renders on the page. There is no any
> exception - just child's fields disappear.
>
> Is it normal behaviour, or a bug? And if normal, why can't beaneditor
> resolve class type and render child object like in first example above?
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to