JavaScript uses so-called camelText for css properties, and as GWT is effectively JavaScript you have to too. Your point has been brought up a few times though as it is not immediately self-obvious, there's now an issue on this to help:
"I suggest that we assert that the style name does not contain a hyphen, and provide a simple explanation if it does so the user can switch to camel case." http://code.google.com/p/google-web-toolkit/issues/detail?id=2667&q=camel //Adam On 28 Nov, 15:07, yilativs <[EMAIL PROTECTED]> wrote: > Recently I've found out that DOM.setStyleAttribute as well as > getElement().getStyle() > do not work for valid properties. At first I thought that it doesn't > work at all but lately I found out that there are very few properties > for which it works: > > Image image = new Image("images/someimage.gif"); > DOM.setStyleAttribute(image.getElement(), "margin-left", "15px");// > does nothing > instead I found out that it works with > DOM.setStyleAttribute(image.getElement(), "marginLeft", "15px");// > works > > DOM.setStyleAttribute(image.getElement(), "coLLLor", "red");//does > nothing > DOM.setStyleAttribute(image.getElement(), "color", "red");//does > nothing > DOM.setStyleAttribute(image.getElement(), "color", "rad");//throws > Invalid property value. > > I found no documentation on such... let's say not evident behavior. > > Does anybody know why gwt developers changed margin-left to > marginLeft? (I guess they use some BeanUtils for this stuff) > why they throw exception on wrong property value but not on wrong > property name? > and > why they do nothing when the property name is correct (like with > color, yes, I know Image does not have such property). > > Regards --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---
