Results 1 to 4 of 4

Thread: need help, bounded nested properties

Hybrid View

  1. #1
    Join Date
    Jan 2006
    Posts
    16

    Default need help, bounded nested properties

    hi everyone

    I have a really troubling strange problem.

    I have a form with bounded nested properties.
    When the nested property is not initialized ( null .. ) the binding process goes through smoothly.
    BUT when i assign a value to the nested property i expect to see it in the bounded form field but what happens is that i get a binding exception
    saying that the bound property is invalid and cannot be found in the class.
    But the class it looks for is wrong, for some reason it searches for the property in the nested property's Type class and not in the class containing the property.

    MY CODE :

    class BoardModel {
    }

    class BoardType{
    }

    class BoardTypeModel {
    private BoardType boardType; //nested property
    private BoardModel boardModel; //nested property

    public BoardType getBoardType(){
    return boardType;
    }
    public void setBoardType( BoardType boardType ){
    this.boardType = boardType;
    }
    public BoardModel getBoardModel(){
    return boardModel;
    }
    public void setBoardModel( BoardModel boardModel ){
    this.boardModel = boardModel;
    }
    }


    The Bean Backing Form Object is :

    class BeanObject {
    private BoardTypeModel board;

    {


    The Binding code :

    createBoundComboBox("board"+".boardModel",valueHol der);
    createBoundComboBox("board" + ".boardType", type.getBoardTypes());

    this works fine
    but when i initiate the nested property boardType = new BoardType();

    i get a binding exception

    org.springframework.beans.NotReadablePropertyExcep tion: Invalid property 'boardType' of bean class [org.springframework.richclient.samples.petclinic.d omain.model.BoardType]: Bean property 'boardType' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?

    I dont understand why it keeps looking in the BoardType Class,
    and not in the BoardTypeModel class where this property is located.

    hope i made myself clear

    would appreciate any help
    i'm really stuck with this guys

    thnks

  2. #2
    Join Date
    Aug 2005
    Location
    Austin, TX
    Posts
    425

    Default

    The Binding code :

    createBoundComboBox("board"+".boardModel",valueHol der);
    createBoundComboBox("board" + ".boardType", type.getBoardTypes());

    this works fine
    but when i initiate the nested property boardType = new BoardType();
    Can you provide a little more of the code that prepares all the bindings on the form? Also, can you explain what you mean when you say "when i initiate the nested property boardType = new BoardType();?" What does that mean? Can you post the code?

    Thanks,
    Larry.

  3. #3
    Join Date
    Jan 2006
    Posts
    16

    Smile my mistake offcourse, don't bother reading

    Hi Larry thanks alot for the quick reply,
    I found what I did wrong, the framework works fine.

    thanks again

  4. #4
    Join Date
    Nov 2009
    Posts
    3

    Default

    Quote Originally Posted by tal_f View Post
    Hi Larry thanks alot for the quick reply,
    I found what I did wrong, the framework works fine.

    thanks again
    If you no what was wrong and you solved the problem. Tell and explain your solution thats were forums are intended! So meaby you can help someone.

    thank you......

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •