Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    FormItem text color does not take

    Be sure your post includes:

    1. GWT 2.3.0, and nightly build of power downloaded on 8/15/2011 with Firefox 5.0.1
    2. n/a
    3. -
    4. -
    5. PROBLEM: I cannot change the font color of a form item's text in the text box. In the index.html page, I have the css code:

    Code:
    	<style type="text/css">
    	.formCellNegative,
    	.formCellNegativeFocused,
    	.formCellNegativeDisabled,
    	.formCellNegativeError
     	{
     	   font-family:Arial,sans-serif; font-size:11px; color:red;
    	}	
    	</style>
    If I change color to background-color, then the form item's background indeed becomes red. I used the following two methods with the above css style:
    Code:
            boundForm.getItem("faceamount").setCellStyle("formCellNegative");
            boundForm.getItem("faceamount").setTitleStyle("formCellNegative");
    and the Title of the FormItem is indeed red, but not the text within the FormItem text box.

    In fact, I changed the font-size to 14px, and only the title changed and not the text in the form box.
    Last edited by michaeljseo; 15 Aug 2011, 08:43.

    #2
    Found the problem. Needed to call the method:

    FormItem:setTextBoxStyle("cssstyle")

    Comment


      #3
      Can you show me the code you used. I tried that by doing this on my textItem

      Code:
      .loginUsernameField {
      	font-family:Verdana,Bitstream Vera Sans,sans-serif;
      	font-size:12px;
      	color:red;
      }
      and then when the form is built

      Code:
       TextItem usernameItem = new TextItem("usernameField");
              usernameItem.setSelectOnFocus(true);  
              usernameItem.setWrapTitle(false);  
              usernameItem.setTitle("Username");
              usernameItem.setTextBoxStyle("loginUsernameField");
              usernameItem.setDefaultValue("<username>");

      Comment

      Working...
      X