zorba-the-geek / smartgwt

Automatically exported from code.google.com/p/smartgwt
0 stars 0 forks source link

Canvas of a ButtonItem is not a Button and Button does not have a setTitleStyle method #101

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
SmartGWT version for this issue: svn revision 266.

When creating a com.smartgwt.client.widgets.form.fields.ButtonItem on a
form, the style of the text being shown on the button can be selected like in
  buttonItem.setTitleStyle("myTitleStyle"); 
This works.
To change the style e.g. in a
  com.smartgwt.client.widgets.form.fields.events.ClickHandler
it would be consistent if
  ((ButtonItem)event.getItem()).setTitleStyle("myStyle"); 
would work, but this has no effect.

Still one might speculate that the style could be changed on the canvas
representing the button item, like in
((ButtonItem)event.getItem()).getCanvas().setTitleStyle("myStyleChanged"); 
but the canvas of type button item
a) does not have a setTitleStyle method
b) is of type Canvas and not of type Button, as one could expect
c) even if it was of type Button, the Button class does not have a
setTitleStyle method.

For consistency reasons I would prefer that the change of the titleStyle
works as the initial setting of the title style: on the button item.

If that does not work due to technical restrictions, at least the Canvas of
the ButtonItem should be a Button with a setTitleStyle method.

Workaround: 
((ButtonItem)event.getItem()).getCanvas().setProperty("titleStyle",
"myStyleChanged");

Original issue reported on code.google.com by christia...@ect-telecoms.de on 30 Jan 2009 at 8:24

GoogleCodeExporter commented 9 years ago
fixed in svn.

Original comment by sanjiv.j...@gmail.com on 30 Jan 2009 at 10:11