Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » How can refresh a widget while running java script.
How can refresh a widget while running java script. [message #524230] Wed, 31 March 2010 09:07 Go to next message
allen  is currently offline allen Friend
Messages: 3
Registered: March 2010
Junior Member
I create a custom widget.
EX: There are a custom widget and a label in my application
There is a button at my custom widget. I want to click button to modify a label simultaneously. The code is js code when click button. I can't get label at js code. How should I do?

[Updated on: Wed, 31 March 2010 09:10]

Report message to a moderator

Re: How can refresh a widget while running java script. [message #524451 is a reply to message #524230] Thu, 01 April 2010 02:40 Go to previous messageGo to next message
allen  is currently offline allen Friend
Messages: 3
Registered: March 2010
Junior Member
I think this is a rap bug. I read help demo (gmap). But I don't find answer I want to get.

[Updated on: Thu, 01 April 2010 02:40]

Report message to a moderator

Re: How can refresh a widget while running java script. [message #524503 is a reply to message #524451] Thu, 01 April 2010 08:01 Go to previous messageGo to next message
Holger Staudacher is currently offline Holger StaudacherFriend
Messages: 166
Registered: July 2009
Senior Member
Hi,
If I understand your problem correctly, you want to update a label with
a button klick, am I right? So, in this case you don't need a custom
widget. It's all solvable with composition.

I.e. create a SWT label and a SWT Button. Change the Text in the
button's selection event. Please provide more information about your
use case if there are some reasons why you don't use composition.

Regards Holger

On 2010-04-01 04:40:02 +0200, allen <tawalisa@163.com> said:

> I think this rap bug. I read help demo (gmap). But I don't answer I
> want to get.


--
-----------------------------------------

http://eclipsesource.com

http://twitter.com/eclipsesource
Re: How can refresh a widget while running java script. [message #524525 is a reply to message #524503] Thu, 01 April 2010 09:19 Go to previous messageGo to next message
allen  is currently offline allen Friend
Messages: 3
Registered: March 2010
Junior Member
Thanks for Holger Staudacher and your answer. But this is not what I want to get.
This is an example only. I want to konw how to use js code to modify rap widget simultaneously. Although as help ( RAP Developer Guide > Advanced Topics-> Custom Widgets about google map and rap ) can tell us js how to transfer to rap . But I don't think it is simultaneous.
this is a js code.
var wm = org.eclipse.swt.WidgetManager.getInstance();
var gmapId = wm.findIdByWidget( this );
var center = div.value;;
var req = org.eclipse.swt.Request.getInstance();
req.addParameter( gmapId + ".centerLocation", center );
req.send();
This code only at a custom widget. It can't get other rap handler(EX: a rap label).
send() method can post a request to server.Handle this logic at LCA(life cycle adapter). but I can't get this label in LCA. So I don't kown how to do.
Re: How can refresh a widget while running java script. [message #524561 is a reply to message #524525] Thu, 01 April 2010 07:30 Go to previous messageGo to next message
Holger Staudacher is currently offline Holger StaudacherFriend
Messages: 166
Registered: July 2009
Senior Member
Hi,
sorry but I can't get the core statement of your problem. Please try to
specify the problem more precisely. Maybe you can describe your usecase
to make it clearer?

Regards Holger


On 2010-04-01 11:19:12 +0200, allen <tawalisa@163.com> said:

> Thanks for Holger Staudacher and your answer. But this is not what I
> want to get.
> This is an example only. I want to konw how to use js code to modify
> rap widget simultaneously. Although as help ( RAP Developer Guide >
> Advanced Topics-> Custom Widgets about google map and rap ) can tell us
> js how to transfer to rap . But I don't think it is simultaneous. this
> is a js code.
> var wm = org.eclipse.swt.WidgetManager.getInstance();
> var gmapId = wm.findIdByWidget( this );
> var center = div.value;;
> var req = org.eclipse.swt.Request.getInstance();
> req.addParameter( gmapId + ".centerLocation", center );
> req.send();
> This code only at a custom widget. It can't get other rap handler(EX: a
> rap label).
> send() method can post a request to server.Handle this logic at
> LCA(life cycle adapter). but I can't get this label in LCA. So I don't
> kown how to do.


--
-----------------------------------------

http://eclipsesource.com

http://twitter.com/eclipsesource
Re: How can refresh a widget while running java script. [message #524565 is a reply to message #524525] Thu, 01 April 2010 12:35 Go to previous message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2427
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi,

I will try to outline one possible solution:
1. Add to your custom widget add/removeSelectionListener
2. Fire a SelectionEvent when you recieve something from the client in
the LCA
3. Update the label value based on your custom widget SelectionEvent

HTH,
Ivan

On 04/01/2010 12:19 PM, allen wrote:
> Thanks for Holger Staudacher and your answer. But this is not what I
> want to get.
> This is an example only. I want to konw how to use js code to modify
> rap widget simultaneously. Although as help ( RAP Developer Guide >
> Advanced Topics-> Custom Widgets about google map and rap ) can tell
> us js how to transfer to rap . But I don't think it is simultaneous.
> this is a js code.
> var wm = org.eclipse.swt.WidgetManager.getInstance();
> var gmapId = wm.findIdByWidget( this );
> var center = div.value;;
> var req = org.eclipse.swt.Request.getInstance();
> req.addParameter( gmapId + ".centerLocation", center );
> req.send();
> This code only at a custom widget. It can't get other rap handler(EX:
> a rap label).
> send() method can post a request to server.Handle this logic at
> LCA(life cycle adapter). but I can't get this label in LCA. So I don't
> kown how to do.
Previous Topic:Notification that click custom widget( run the J.S. file )to show information for a view
Next Topic:Open extra View dynamacluy in place holder tabs donet update in
Goto Forum:
  


Current Time: Sun Oct 13 20:33:17 GMT 2024

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

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

Back to the top