Home » Eclipse Projects » Eclipse Platform » [Databinding] Valuebinding: Model To Target Synchronisation
[Databinding] Valuebinding: Model To Target Synchronisation [message #327573] |
Fri, 25 April 2008 04:06  |
Eclipse User |
|
|
|
Originally posted by: eclipse.news.yahoo.de
Hi,
I'm starting some experiments with the eclipse data binding in RCP
applications.
In fact, I only have a simple Text widget to be synchronized with a double
in my domain model.
So that, the following code support should support such synchronization:
--
DataBindingContext context = new DataBindingContext();
context.bindValue(SWTObservables.observeText(txBox, SWT.Modify),
BeansObservables.observeValue(domainData, "amount"),
null, null);
--
The target to model synchronization works very well. Additionally, the
'amount' is represented in the Eclipse Property View as an editable value
(via a TextPropertyDescriptor). If I edit the 'amount' via the Property
View, I would expect that the corresponding txBox is updated (since the
data binding supports also a model to target sync).
However, the model to target sync doesn't work in that case.
Is there any idea why it doesn't works and how I can solve the problem?
Thanks
|
|
|
Re: [Databinding] Valuebinding: Model To Target Synchronisation [message #327577 is a reply to message #327573] |
Fri, 25 April 2008 06:10   |
Eclipse User |
|
|
|
Hi,
Does you model fire PropertyChangeEvents and does it provide a
add/removePropertyChangeListener-method.
The bad thing in 3.3 is that you won't see an error in this case as far
as I remember but the symptoms are exactly like you describe them.
Tom
H.Mueller schrieb:
> Hi,
>
> I'm starting some experiments with the eclipse data binding in RCP
> applications.
> In fact, I only have a simple Text widget to be synchronized with a
> double in my domain model.
> So that, the following code support should support such synchronization:
>
> --
> DataBindingContext context = new DataBindingContext();
> context.bindValue(SWTObservables.observeText(txBox, SWT.Modify),
> BeansObservables.observeValue(domainData, "amount"),
> null, null);
> --
>
> The target to model synchronization works very well. Additionally, the
> 'amount' is represented in the Eclipse Property View as an editable
> value (via a TextPropertyDescriptor). If I edit the 'amount' via the
> Property View, I would expect that the corresponding txBox is updated
> (since the data binding supports also a model to target sync).
> However, the model to target sync doesn't work in that case.
>
> Is there any idea why it doesn't works and how I can solve the problem?
>
> Thanks
>
--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
|
|
|
Re: [Databinding] Valuebinding: Model To Target Synchronisation [message #327578 is a reply to message #327577] |
Fri, 25 April 2008 06:17   |
Eclipse User |
|
|
|
Originally posted by: eclipse.news.yahoo.de
Yes, the model provides PropertyChangeEvents including their corresponding add and remove methods.
And in the set method of the 'amount' value a property change event is fired.
Hermann
Tom Schindl schrieb:
> Hi,
>
> Does you model fire PropertyChangeEvents and does it provide a
> add/removePropertyChangeListener-method.
>
> The bad thing in 3.3 is that you won't see an error in this case as far
> as I remember but the symptoms are exactly like you describe them.
>
> Tom
>
> H.Mueller schrieb:
>> Hi,
>>
>> I'm starting some experiments with the eclipse data binding in RCP
>> applications.
>> In fact, I only have a simple Text widget to be synchronized with a
>> double in my domain model.
>> So that, the following code support should support such synchronization:
>>
>> --
>> DataBindingContext context = new DataBindingContext();
>> context.bindValue(SWTObservables.observeText(txBox, SWT.Modify),
>> BeansObservables.observeValue(domainData, "amount"),
>> null, null);
>> --
>>
>> The target to model synchronization works very well. Additionally, the
>> 'amount' is represented in the Eclipse Property View as an editable
>> value (via a TextPropertyDescriptor). If I edit the 'amount' via the
>> Property View, I would expect that the corresponding txBox is updated
>> (since the data binding supports also a model to target sync).
>> However, the model to target sync doesn't work in that case.
>>
>> Is there any idea why it doesn't works and how I can solve the problem?
>>
>> Thanks
>>
>
>
|
|
|
Re: [Databinding] Valuebinding: Model To Target Synchronisation [message #327581 is a reply to message #327578] |
Fri, 25 April 2008 06:38  |
Eclipse User |
|
|
|
Then I'm afraid you'll need to provide a snippet for us to run and see
what's going on. Do you run youre application with -consoleLog to see if
there are any exceptions?
Tom
H.Mueller schrieb:
>
> Yes, the model provides PropertyChangeEvents including their
> corresponding add and remove methods.
> And in the set method of the 'amount' value a property change event is
> fired.
>
> Hermann
>
> Tom Schindl schrieb:
>> Hi,
>>
>> Does you model fire PropertyChangeEvents and does it provide a
>> add/removePropertyChangeListener-method.
>>
>> The bad thing in 3.3 is that you won't see an error in this case as
>> far as I remember but the symptoms are exactly like you describe them.
>>
>> Tom
>>
>> H.Mueller schrieb:
>>> Hi,
>>>
>>> I'm starting some experiments with the eclipse data binding in RCP
>>> applications.
>>> In fact, I only have a simple Text widget to be synchronized with a
>>> double in my domain model.
>>> So that, the following code support should support such synchronization:
>>>
>>> --
>>> DataBindingContext context = new DataBindingContext();
>>> context.bindValue(SWTObservables.observeText(txBox, SWT.Modify),
>>> BeansObservables.observeValue(domainData, "amount"),
>>> null, null);
>>> --
>>>
>>> The target to model synchronization works very well. Additionally,
>>> the 'amount' is represented in the Eclipse Property View as an
>>> editable value (via a TextPropertyDescriptor). If I edit the 'amount'
>>> via the Property View, I would expect that the corresponding txBox is
>>> updated (since the data binding supports also a model to target sync).
>>> However, the model to target sync doesn't work in that case.
>>>
>>> Is there any idea why it doesn't works and how I can solve the problem?
>>>
>>> Thanks
>>>
>>
>>
--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
|
|
|
Goto Forum:
Current Time: Thu Apr 17 04:30:08 EDT 2025
Powered by FUDForum. Page generated in 0.04679 seconds
|