I have
HTML test = new HTML( "myhtml" );
which generates
<div class="gwt-HTML">MyHTML</div>
I want to set the primary style using this:
HTML.setStylePrimaryName(null, "mystyle");
What must be the first Paramter? Null is not working.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The
UIObject.setStylePrimaryNamestatic method is for when you have to work withElements (you’ll also note that it’sprotected, it really is an implementation detail of widgets and other UI objects).You’d want to use the
setStylePrimaryNameinstance method:But actually, most of the time, you’d better use
addStyleName, to keep thegwt-HTMLclass name around (or in the case of aTextBoxfor instance, keep thegwt-TextBoxandgwt-TextBox-readonly; if you change the primary name tomystyle, you’ll then havemystyle-readonlyinstead ofgwt-TextBox-readonly, it is sometimes desirable, but most of the time it’s not):