User problem with Databinding

SWT Designer allows you to create the views, editors, perspectives, pref pages, composites, etc. that comprise Eclipse SWT & RCP applications and plug-ins.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

User problem with Databinding

Postby raven » Fri Jul 20, 2007 12:33 pm

Hi,

My environment is: Eclipse 3.3 Release, Latest RCP Developer Release

Problem:

I have placed 3 SWT text controls and labels on a composite in the ViewPart of an RCP application.

The same view contains a Bean representing the Domain Object. This bean has 3 corresponding attributes.

Now, using the Designer to bind those, creates following code:

bindingContext.bindValue(txtFirstNameTextObserveWidget, personFirstNameObserveValue, null, null);

... the tool is now complaining about the generated code, it obviously expects something like this:

bindingContext.bindValue(txtFirstNameTextObserveWidget, personFirstNameObserveValue, null);

Why is that? What did I do wrong?


Thanks a lot
raven
 
Posts: 5
Joined: Wed Sep 06, 2006 11:38 am

Re: User problem with Databinding

Postby Eric Clayberg » Fri Jul 20, 2007 5:58 pm

You appear to be using an pre-release version of Eclipse 3.3 as there is no 3-argument version of the bindValue() method in the Eclipse 3.3 final release.

The Eclipse 3.3 release version of the method has 4 arguments...

Code: Select all
   public final Binding bindValue(IObservableValue targetObservableValue,
         IObservableValue modelObservableValue,
         UpdateValueStrategy targetToModel, UpdateValueStrategy modelToTarget) {
      UpdateValueStrategy targetToModelStrategy = targetToModel != null ? targetToModel
                  : createTargetToModelUpdateValueStrategy(targetObservableValue, modelObservableValue);
      UpdateValueStrategy modelToTargetStrategy = modelToTarget != null ? modelToTarget
            : createModelToTargetUpdateValueStrategy(modelObservableValue, targetObservableValue);
      targetToModelStrategy.fillDefaults(targetObservableValue, modelObservableValue);
      modelToTargetStrategy.fillDefaults(modelObservableValue, targetObservableValue);
      ValueBinding result = new ValueBinding(targetObservableValue,
            modelObservableValue, targetToModelStrategy,
            modelToTargetStrategy);
      result.init(this);
      return result;
   }
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA


Return to SWT Designer

Who is online

Users browsing this forum: No registered users and 2 guests