Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Problem with Custom Widget .set()(Problem with Custom Widget .set())
Problem with Custom Widget .set() [message #1455536] Wed, 29 October 2014 13:20 Go to next message
Maciej Gorski is currently offline Maciej GorskiFriend
Messages: 4
Registered: October 2014
Junior Member
Hi,
i have written a simple custom widget ( my second in all ) with RAP 2.3 but encountered a problem in further implementation. Basicly i need a HTML viewer which can show html content or XML. For that purpose my custom widget creates a Iframe element and will be filled with information. The set up and creation works flawless.

Now during java server workflow this will be called

	public void setContent( String aContent ) {
		if ( this.aContent != null && !this.aContent .equals( "" ) ) {
			cliObj.set( "frmCtt", aContent ); // cliObj is my registered RemoteObject
		}
	}


The problem now is that after the .set() the property is send (i looked the network in Chrome Dev Tools) as json but the field value hasnt changed.

	/**
	 * Class prototype
	 */
	test.myCustomWidget.prototype = {

                frmCtt	: "", // Thats the Property field not changing

		ready : false,

		onReady : function() {
			this.ready = true;
			this.layout();
		},
		
		
                .... further code


If i use .call() in java instead and change the field to a function it works, but i am not sure if call triggers a new render in some kind and i DONT want to render i just want to change the value.

Thanks in advance and sorry for mistakes Embarrassed
Re: Problem with Custom Widget .set() [message #1456231 is a reply to message #1455536] Thu, 30 October 2014 06:22 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2334
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi,
did you create a JavaScript type handler for your custom widget [1]? Is
your property listed in the handler:

|rap.registerTypeHandler( "my.CustomWidgetType", {
factory : function( properties ) {
return new MyCustomWidget( properties );
},

properties : [ "||frmCtt" ]
} );|

and in your widget JS prototype you need function setFrmCtt( value )
where you will actually do the update of the property.

[1]
https://wiki.eclipse.org/RAP/Custom_Widgets_FAQ#What_is_the_basic_architecture_of_a_Custom_Widget.3F

HTH,
Ivan

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Problem with Custom Widget .set() [message #1457479 is a reply to message #1456231] Fri, 31 October 2014 11:15 Go to previous message
Maciej Gorski is currently offline Maciej GorskiFriend
Messages: 4
Registered: October 2014
Junior Member
OK i just forgot or wasnt aware that there is a field called properties required

I added
properties : [ "frmCtt" ]


and now everything works fine.

THANK YOU VERY MUCH Very Happy
Previous Topic:Localization problems
Next Topic:Can we use the Dependency Injection feture of E4 in RAP
Goto Forum:
  


Current Time: Fri Feb 28 22:57:21 GMT 2020

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

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

Back to the top