-
4 Oct 2012 12:33 AM #1
ButtonCellDefaultAppearance: problems with icon display
ButtonCellDefaultAppearance: problems with icon display
I need to set only icon to button, and no text. Also, I need this button to be TextButton.
Following situation: I place icon, and I dont place any text to it.
Result - I see empty space on the right. When I am looking on it in firebug, it shows empty <td> tag.
According to sources of gxt:variable text is never null. But below, in the same method we see:Code:public void render(final ButtonCell<C> cell, Context context, C value, SafeHtmlBuilder sb) { String constantHtml = cell.getHTML(); boolean hasConstantHtml = constantHtml != null && constantHtml.length() != 0; boolean isBoolean = value != null && value instanceof Boolean; // is a boolean always a toggle button? String text = hasConstantHtml ? cell.getText() : (value != null && !isBoolean) ? SafeHtmlUtils.htmlEscape(value.toString()) : "";
It is checked on null, but it is never null it self. That is why we see empty space on button.Code:case LEFT: inside.appendHtmlConstant("<tr>"); writeIcon(inside, icon, height); if (text != null) { int w = width - (icon != null ? icon.getWidth() : 0) - 4; writeText(inside, text, w, height); }
Does any workaround exist?
-
4 Oct 2012 5:13 PM #2
If not displaying text, why are you using a TextButton? Why not IconButton or ToolButton?
-
4 Oct 2012 11:42 PM #3
In future we can use both text and icon there(and there is possibility for customer to add this text)
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote