[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform] Re: [Databinding] Handle persistent & generation of new objects

Hi,

I'm using master-detail support for this kind of things:

WriteableValue v = new WriteableValue();
v.setValue(new ModelObject());

IObservableValue model = BeanObserables.observeDetail(
   Realm.getDefault(),
   v,
   "attribute"
);
IObservableValue ui = SWTObservable.observeText(....);

... later on when I create a new object once more

v.setValue(new ModelObject());

Tom

Gerrit Brehmer schrieb:
Hi,

I use last Eclipse Databindung (europa fall) + Hibernate(JPA) + SWT + SWT Designer (WindowBuilder Pro).

In want to create new entrys for my database with my application.

In my view class there is one member variable for an instance of my model object. I have bound the attributes of this object to a few textfields & comboboxes. If I want to make a new instance of my object (to create a new entry), I set the current instance to null and set the member variable with a new instance of my model class. But the old instance is still bound to the gui elements and so the new values will be written in the old & and the new instance.
I have tried to remove the bindings and rerun initialization of the databindings, but no luck.
Thanks in advance for your help!
Gerrit




--
B e s t S o l u t i o n . at
--------------------------------------------------------------------
Tom Schindl                                          JFace-Committer
--------------------------------------------------------------------