Make a ManyToOne not editable by program

Laurent
2013-03-22
2013-03-28
  • Laurent
    Laurent
    2013-03-22

    Hi,

    I am trying to make a @ManyToOne field read only in certain cases. It should be displayed so the user knows about it and the Save keeps it but editable. In most case it will be editable.

    I have tried

    getView().setEditable("lot", false);
    

    and various possibilities

    getView().setEditable("lot.id", false);
    

    with no luck so far: it works perfectly for primitives but not for references.

    Can anybody help?

    Thanks,

    Laurent

     
    Last edit: Laurent 2013-04-01
  • Juan Mendoza
    Juan Mendoza
    2013-03-23

    Hi Laurent,

    Try getView().setKeyEditable(false) if you are in the view, if are outside then getView().getSubView(viewNama).setKeyEditable(false)

    Hope this help.

     
  • Laurent
    Laurent
    2013-03-28

    Hi Juan,

    Yes it did help a lot: everything works now.

    Thanks!