Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » How to add custom html attributes(How to add custom html attributes)
How to add custom html attributes [message #1385895] Thu, 12 June 2014 07:44 Go to next message
Christian Hager is currently offline Christian HagerFriend
Messages: 53
Registered: July 2009
Location: Germany
Member
I'm trying to add custom html attributes to some rap widgets and was wondering what's the best way to do so?

If I understand correctly this can be achieved using ClientScripting but I'm looking for a somewhat more generic way. In an optimal case I would like to add an attribute to all Text-Widgets without changing my existing application.

Is that possible?

Thanks in advance for any hint or help.

[Updated on: Wed, 18 June 2014 12:43]

Report message to a moderator

Re: How to add custom html attributes [message #1386588 is a reply to message #1385895] Wed, 18 June 2014 12:46 Go to previous messageGo to next message
Christian Hager is currently offline Christian HagerFriend
Messages: 53
Registered: July 2009
Location: Germany
Member
Ok I found the js-API to set custom attributes to my widgets but I still fail to see the place where I can hook my code into the widget creation lifecycle! Any hints on that?
Re: How to add custom html attributes [message #1386594 is a reply to message #1386588] Wed, 18 June 2014 13:48 Go to previous message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi,
this code works for me:
---
Button pushButton = new Button( parent, SWT.PUSH );
JavaScriptExecutor executor = RWT.getClient().getService(
JavaScriptExecutor.class );
if( executor != null ) {
executor.execute( "rap.getObject(\"" + WidgetUtil.getId( pushButton )
+ "\").$el.attr(\"foo\", \"bar\");" );
}
---
HTH,
Ivan

--
Ivan Furnadjiev

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

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Previous Topic:[RAP] [E4] How to disable MinMax-Icons/Functionality
Next Topic:Loading a font .ttf file
Goto Forum:
  


Current Time: Sat Apr 20 04:17:18 GMT 2024

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

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

Back to the top