Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » [Databinding] Can a bound bean be null?
[Databinding] Can a bound bean be null? [message #760085] Thu, 01 December 2011 09:17 Go to next message
Roded Bahat is currently offline Roded BahatFriend
Messages: 152
Registered: August 2011
Senior Member
Hello,
I'm playing around with JFace databinding, and I've encountered the following problem:
I've bound a org.w3c.dom.Element to a Text widget, by binding the Text's "text" property and the Element's firstChild.nodeValue (<element>thevalue</element>).
This works well, except for the case when the Element variable is null, in which case the generated PojoObservables.observeValue call throws a NPE.
Further more, in case it variable IS null and the Text's value is changed, I would like to created the Element object and assign the new value to it.

Is there a way around this? or perhaps my method can be better?
This is probably a trivial matter, but I can't seem to find documentation on the matter.
Would appreciate any help.
Thanks a lot,
Roded
Re: [Databinding] Can a bound bean be null? [message #760279 is a reply to message #760085] Thu, 01 December 2011 18:16 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Hi,

Well this is not easily doable out of the box yet. You need to have an
intermediate broker kind of thing.

Can you please show us exactly how your observable creation is done at
the moment?

Tom

Am 01.12.11 10:17, schrieb Roded:
> Hello,
> I'm playing around with JFace databinding, and I've encountered the
> following problem:
> I've bound a org.w3c.dom.Element to a Text widget, by binding the Text's
> "text" property and the Element's firstChild.nodeValue
> (<element>thevalue</element>).
> This works well, except for the case when the Element variable is null,
> in which case the generated PojoObservables.observeValue call throws a NPE.
> Further more, in case it variable IS null and the Text's value is
> changed, I would like to created the Element object and assign the new
> value to it.
>
> Is there a way around this? or perhaps my method can be better?
> This is probably a trivial matter, but I can't seem to find
> documentation on the matter.
> Would appreciate any help.
> Thanks a lot,
> Roded
Re: [Databinding] Can a bound bean be null? [message #765046 is a reply to message #760279] Tue, 13 December 2011 10:16 Go to previous message
Roded Bahat is currently offline Roded BahatFriend
Messages: 152
Registered: August 2011
Senior Member
Sorry for neglecting this post.
I have relocated my efforts to Sapphire.
Thanks
Previous Topic:[Resolved] EMF / JFace howto do a 'double' databinding
Next Topic:Default button in Message Dialog Issue
Goto Forum:
  


Current Time: Sat Apr 20 01:20:45 GMT 2024

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

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

Back to the top