Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Share data between XWT instances ?
Share data between XWT instances ? [message #535531] Mon, 24 May 2010 09:37 Go to next message
A. BoughlamFriend
Messages: 14
Registered: May 2010
Junior Member
Hi everyone,

My question is : How can I access to another XWT instance ?
For example If I have a 'People.xwt' view with a list of persons and a button 'Add'. If I click on 'Add' it instanciate a 'Person' object and open a 'Person.xwt' view for editing. How can i add this 'Person' object to the list of persons in the people view ?

Thanks in advance.

A. Boughlam.


Best Regards,
A. Boughlam
Re: Share data between XWT instances ? [message #535811 is a reply to message #535531] Tue, 25 May 2010 18:10 Go to previous messageGo to next message
Yves YANG is currently offline Yves YANGFriend
Messages: 688
Registered: July 2009
Senior Member
You just need to get the root person, and then add the new person in ths
list of persons..

Regards
Yves YANG
"A. Boughlam" <a.boughlam@netfective.ma> wrote in message
news:htdhdd$ahh$1@build.eclipse.org...
> Hi everyone,
>
> My question is : How can I access to another XWT instance ? For example If
> I have a 'People.xwt' view with a list of persons and a button 'Add'. If
> I click on 'Add' it instanciate a 'Person' object and open a 'Person.xwt'
> view for editing. How can i add this 'Person' object to the list of
> persons in the people view ?
> Thanks in advance.
>
> A. Boughlam.
Re: Share data between XWT instances ? [message #535891 is a reply to message #535811] Wed, 26 May 2010 08:44 Go to previous messageGo to next message
A. BoughlamFriend
Messages: 14
Registered: May 2010
Junior Member
Thanks for your response but perhaps I didn't express myself adequately (the 'people' example is just what i had in mind at that time).
What I need to know is how to access to an element in another xwt file ? The 'findElementByName' method work only in the current file (it returns null otherwise).

Best regards, and great work by the way Yves.
A. Boughlam


Best Regards,
A. Boughlam
Re: Share data between XWT instances ? [message #536027 is a reply to message #535891] Wed, 26 May 2010 16:32 Go to previous message
Yves YANG is currently offline Yves YANGFriend
Messages: 688
Registered: July 2009
Senior Member
OK, I understood better your request.

In XWT, there is a concept of the name scope management. A scope corresponds
to a resource file. The name scope maanger is hold by the root UI element of
each resource. A name must be unique in the scope. The 'findElementByName'
uses the context widget to file the current name scope maanger, if the name
doesn't exist in this scope manager, the search will continue in the parent
of the name scope maanger.

Let's say we have two XWT files A and B. A embeds B. If you have the
context widget in A, you can use 'findElementByName' to find only the UI
element in A, not inside B. If you want find an element in B, you need first
to find the container of B and use the B (or probably its child) as the
context widget to find the nested element. Be frankly, we have not written a
testcase, I just give the concept. Please let me know if it works. I
appreciate if you can contribute this testcase.

Best regards
Yves YANG
"A. Boughlam" <a.boughlam@netfective.ma> wrote in message
news:htin1b$259$1@build.eclipse.org...
> Thanks for your response but perhaps I didn't express myself adequately
> (the 'people' example is just what i had in mind at that time). What I
> need to know is how to access to an element in another xwt file ? The
> 'findElementByName' method work only in the current file (it returns null
> otherwise).
>
> Best regards, and great work by the way Yves.
> A. Boughlam
Re: Share data between XWT instances ? [message #576777 is a reply to message #535811] Wed, 26 May 2010 08:44 Go to previous message
Eclipse UserFriend
Originally posted by: a.boughlam.netfective.ma

Thanks for your response but perhaps I didn't express myself adequately (the 'people' example is just what i had in mind at that time).
What I need to know is how to access to an element in another xwt file ? The 'findElementByName' method work only in the current file (it returns null otherwise).

Best regards, and great work by the way Yves.
A. Boughlam
Re: Share data between XWT instances ? [message #576790 is a reply to message #576777] Wed, 26 May 2010 16:32 Go to previous message
Yves YANG is currently offline Yves YANGFriend
Messages: 688
Registered: July 2009
Senior Member
OK, I understood better your request.

In XWT, there is a concept of the name scope management. A scope corresponds
to a resource file. The name scope maanger is hold by the root UI element of
each resource. A name must be unique in the scope. The 'findElementByName'
uses the context widget to file the current name scope maanger, if the name
doesn't exist in this scope manager, the search will continue in the parent
of the name scope maanger.

Let's say we have two XWT files A and B. A embeds B. If you have the
context widget in A, you can use 'findElementByName' to find only the UI
element in A, not inside B. If you want find an element in B, you need first
to find the container of B and use the B (or probably its child) as the
context widget to find the nested element. Be frankly, we have not written a
testcase, I just give the concept. Please let me know if it works. I
appreciate if you can contribute this testcase.

Best regards
Yves YANG
"A. Boughlam" <a.boughlam@netfective.ma> wrote in message
news:htin1b$259$1@build.eclipse.org...
> Thanks for your response but perhaps I didn't express myself adequately
> (the 'people' example is just what i had in mind at that time). What I
> need to know is how to access to an element in another xwt file ? The
> 'findElementByName' method work only in the current file (it returns null
> otherwise).
>
> Best regards, and great work by the way Yves.
> A. Boughlam
Previous Topic:E4 versus E3 for Eclipse applications
Next Topic:XWT fails to load x:Class class
Goto Forum:
  


Current Time: Thu Mar 28 15:13:44 GMT 2024

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

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

Back to the top