This discussion is archived
3 Replies Latest reply: Sep 24, 2010 5:22 AM by EJP RSS

Beans binding problem

843807 Newbie
Currently Being Moderated
I have the following situation:
- A static class "Data" with reference to a class "Basic"
- A JPanel which includes a reference to Basic from Data (Data.getBasic())
- Inside of JPanel all form elements are bind to the reference of Basic
- Now another process is creating a new instance of Basic and is calling Data.setBasic(newBasic)

The problem now is that all bind elements inside the JPanel are not aware that the reference of Basic is invalid. A call to update the basic reference inside JPanel is not changing anything.

A refresh on my bindinggroup does not have any effect.

Does anybody have a solution for that problem ?
  • 1. Re: Beans binding problem
    EJP Guru
    Currently Being Moderated
    - A static class "Data" with reference to a class "Basic"
    A static reference? There's the problem right there. Data is only designed to be used with one instance of Basic. If you have a need for > 1 instance of Basic you have to redesign Data.
  • 2. Re: Beans binding problem
    843807 Newbie
    Currently Being Moderated
    I do not want more than one instance of basic. The problem is that the reference of basic can be replaced by the server component and therefore I need a way to update the GUI elements.
  • 3. Re: Beans binding problem
    EJP Guru
    Currently Being Moderated
    I do not want more than one instance of basic.
    Maybe not, but you have got more than one instance of Basic. So your design has to cope. As you've described it here, it doesn't. When Data.setBasic() gets called, you have more work to do.