16 Jun 2009 2:47 AM #1
[GXT 2.0 m3] Pb with setIconStyle
Just upgraded to 2.0-m3 and saw that the setIconStyle method on a Button doesn't add the class to my button element (in the generated Html) anymore.
Button excelButton = new Button(); excelButton.setText(buttonLabel); excelButton.setIconStyle("excel-button");
16 Jun 2009 2:50 AM #2
This is not a bug. I will move this to the help forum. SetIconStyle only sets the icon.
If you want a stylename, you have to use addStyleName
16 Jun 2009 5:11 AM #3
16 Jun 2009 5:26 AM #4
You should probably explain what you are doign with this css rule.
16 Jun 2009 5:45 AM #5
I recompiled my code -without changing aything- with the 2.0-m2, and both setIconStyle and addStyleName are working.
So I confirm that this seems to be a bug in the 2.0-m3 version.
If I'm wrong, tell me why.
This is what I'm doing :
Button excelButton = new Button(); excelButton.setText(buttonLabel); excelButton.setIconStyle("excel-button"); excelButton.addSelectionListener(...); ToolBar toolbar = new ToolBar(); toolbar.add(excelButton); this.setTopComponent(toolbar);
<button class="x-btn-text" ...>
16 Jun 2009 5:50 AM #6
addStyleName is not appliying anything to the button element. It is applying something to the main element. You need to update your css rules according to that. setIconStyle is only for setting an icon (this was also documented)
16 Jun 2009 5:59 AM #7
My rule was :Code:
And now -in the 2.0-m3- I agree, not anymore.