1

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;">
Carvallegro
  • 1,241
  • 4
  • 16
  • 24
  • 1
    Sorry, I forgot all my manners, question edited with the code and every solutions I've tried plus the generated html. – Carvallegro Jun 12 '15 at 12:40
  • I don't have a solution. But as far as I remember, GXT renders some stuff lazily. That means the element you want to work with doesn't exist before it has been shown (=> rendered). Is the toolbar in your example still added to some shown panel? – Code_Eraser Jun 16 '15 at 06:24
  • You're right about the lazy part. I have to wait for the compontent to be rendered to access his Element. I'm gonna try a workaround – Carvallegro Jun 16 '15 at 06:44

0 Answers0