Announcement Announcement Module
Collapse
No announcement yet.
need help, bounded nested properties Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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.

    Comment


    • #3
      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

      Comment


      • #4
        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......

        Comment

        Working...
        X