Pregunta

By any chance is there a way to change/alter a style parameter with Java that is used with GWT. Suppose if i have a component in ui.xml file as ui:field="DivUserNameTop" and if i want to alter the color of the DIV 'DivUserNameTop' what property can i use? I tried some googling but nothing helped.

TO MAKE IT MORE CLEAR - If suppose i have to load the color of the div from the session(i.e each user has each color pre-defined in a db and that value will be set in the session say SESSION_COLOR once they authenticate), how do i set the SESSION_COLOR to a DIV with GWT

¿Fue útil?

Solución

You use css styles. You can either use styles directly from a css file, or get a little more efficient and wrap the styles in a cssresource class. Then to set the styles on gwt widgets you call methods on the widget. To set styles on a DOM element you can call setElementProperty or DOM.setStyleAttribute to set individual styles properties.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top