Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » [DataBinding] ListBinding issue with uni-directional ON_REQUEST update
[DataBinding] ListBinding issue with uni-directional ON_REQUEST update [message #330772] Wed, 13 August 2008 00:32 Go to next message
Eclipse UserFriend
Originally posted by: evolanakis.innoopract.com

Hi,

please let me know if I should file a bug for this, or I just
misunderstood something.

I'm binding two IObservableLists named target and model. Update from
target to model is automatic. Update from model to target is on request.

The strange thing is that invoking binding.updateModelToTarget() will
not pick up the changes in mdlBean (which properly fires events). This
can be worked around by adding a dummy listener to the model. :-P

Code Example (using Eclipse 3.4)

IObservableList target
= BeansObservables.observeList(realm, tgtBean, tgtProperty);
IObservableList model
= BeansObservables.observeList(realm, mdlBean, mdlPropert);
Binding binding = dbc.bindList(
target,
model,
new UpdateListStrategy(UpdateListStrategy.POLICY_UPDATE),
new UpdateListStrategy(UpdateListStrategy.POLICY_ON_REQUEST));

// try modifying the model
mdlBean.addSomething(...);
binding.updateModelToTarget(); // result: target/tgtBean unchanged

// add listener (once)
binding.getModel().addChangeListener(new IChangeListener() {
public void handleChange(ChangeEvent event) {
// dummy listener
}});

// try modifying the model
mdlBean.addSomething(...);
binding.updateModelToTarget(); // result: target/tgtBean changed


Thanks for your response,
Elias.

--
---
Elias Volanakis
Innoopract, Inc.
http://www.innoopract.com
Re: [DataBinding] ListBinding issue with uni-directional ON_REQUEST update [message #330812 is a reply to message #330772] Wed, 13 August 2008 16:39 Go to previous messageGo to next message
Eclipse UserFriend
Please file a bug (or could this be caused by
https://bugs.eclipse.org/bugs/show_bug.cgi?id=236605 ?)

Boris

"Elias Volanakis" <evolanakis@innoopract.com> wrote in message
news:g7to4h$td$1@build.eclipse.org...
> Hi,
>
> please let me know if I should file a bug for this, or I just
> misunderstood something.
>
> I'm binding two IObservableLists named target and model. Update from
> target to model is automatic. Update from model to target is on request.
>
> The strange thing is that invoking binding.updateModelToTarget() will
> not pick up the changes in mdlBean (which properly fires events). This can
> be worked around by adding a dummy listener to the model. :-P
>
> Code Example (using Eclipse 3.4)
>
> IObservableList target
> = BeansObservables.observeList(realm, tgtBean, tgtProperty);
> IObservableList model
> = BeansObservables.observeList(realm, mdlBean, mdlPropert);
> Binding binding = dbc.bindList(
> target,
> model,
> new UpdateListStrategy(UpdateListStrategy.POLICY_UPDATE),
> new UpdateListStrategy(UpdateListStrategy.POLICY_ON_REQUEST));
>
> // try modifying the model
> mdlBean.addSomething(...);
> binding.updateModelToTarget(); // result: target/tgtBean unchanged
>
> // add listener (once)
> binding.getModel().addChangeListener(new IChangeListener() {
> public void handleChange(ChangeEvent event) {
> // dummy listener
> }});
>
> // try modifying the model
> mdlBean.addSomething(...);
> binding.updateModelToTarget(); // result: target/tgtBean changed
>
>
> Thanks for your response,
> Elias.
>
> --
> ---
> Elias Volanakis
> Innoopract, Inc.
> http://www.innoopract.com
Re: [DataBinding] ListBinding issue with uni-directional ON_REQUEST update [message #330814 is a reply to message #330812] Wed, 13 August 2008 19:48 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: evolanakis.innoopract.com

See https://bugs.eclipse.org/bugs/show_bug.cgi?id=244098

Regards,
Elias.


Boris Bokowski wrote:
> Please file a bug (or could this be caused by
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=236605 ?)

---
Elias Volanakis
Innoopract, Inc.
http://www.innoopract.com
Re: [DataBinding] ListBinding issue with uni-directional ON_REQUEST update [message #1431332 is a reply to message #330814] Thu, 25 September 2014 10:40 Go to previous message
Eclipse UserFriend
Just use something good.
Previous Topic:CommonNavigator Filters : how to shown only files (*.xmlprj) and parent folders ?
Next Topic:Platform example for active but disabled handler
Goto Forum:
  


Current Time: Sat Mar 08 02:38:50 EST 2025

Powered by FUDForum. Page generated in 0.03344 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top