3

for example I have a css in test.css given below.

.test {

  top:100px;

 }

how can i increment top property from GWT ?

2 Answers 2

2

e.g. you can retrieve the Style of the element and alter that. other type of widgets might have other functionalities

Sign up to request clarification or add additional context in comments.

1 Comment

thank you i tested nice shot , but i previously wrote some gwt program such as changing setAttribute("style","top:101px;"),in FF,chrome it is OK but in IE it stays its default position but now i dont use setAttribute ,instead i use getElement().getStyle().setTop("101",Unit.PX);
1

You can hold value in memory and just set it at any time you need it via runtime substitution which is built-in GWT feature.

@eval userBackground com.module.UserPreferences.getUserBackground();
div {
   background: userBackground;
}

public class UserPreferences {
    public static String getUserBackground() {
        return "#FF0000";
    }
}

Please check GWT specs: http://www.gwtproject.org/doc/latest/DevGuideClientBundle.html#Runtime_substitution

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.