GWT/GXT Element add Attribute

424 Views Asked by At

I'm looking to use the intro.js javascript library in my GWT project but I have trouble adding the data-intro attribute. I've tried the Setting data- attribute in GWT / Bootstrap solution but I have absolutely nothing in the generated html. Do I have to do that after my element is added ? before ?

EDIT : I'm using the GXT framework, maybe it's because why it doesn't work because some components aren't using Element but El

Here's my code with each differents solutions I've tried :

addButton = createADDBUTTON( false, "add", Resources.ICONS.addButton() );
addButton.addStyleName( "new-button" );
addButton.setIconAlign( IconAlign.LEFT );
// before adding the button
addButton.getElement().setAttribute( "data-intro", "Hello step one" ); // 1
addButton.getElement().setPropertyString( "data-intro", "Hello step one" ); // 2
toolBar.add( addButton );
// after adding the button
addButton.getElement().setAttribute( "data-intro", "Hello step one" ); // 3
addButton.getElement().setPropertyString( "data-intro", "Hello step one" ); // 4
DOM.setElementAttribute( addButton.getElement(), "data-intro", "Hello step one" ); // 5 even tried with DOM

And I have absolutely nothing in the generated html :

<table cellspacing="0" role="presentation" id="x-auto-299" class=" x-btn b-new-button x-component x-btn-text-icon x-unselectable " unselectable="on" style="margin-right: 0px;">
0

There are 0 best solutions below