SmartGWT version: 5.1-p20170201
I have been trying to have the style of a TextItem change when the cursor is over the text item. I’m trying to do this with using the style state naming convention with the “Over” suffix.
Here is the test Java code:
Here are the test CSS styles I’m using:
My results are:
I have been trying to have the style of a TextItem change when the cursor is over the text item. I’m trying to do this with using the style state naming convention with the “Over” suffix.
Here is the test Java code:
Code:
[B]public[/B] [B]class[/B] OverStyleChangeEntry [B]implements[/B] EntryPoint { @Override [B]public[/B] [B]void[/B] onModuleLoad() { dynamicForm().show(); } [B]private[/B] DynamicForm dynamicForm() { [B]return[/B] [B]new[/B] DynamicForm() { { setItems(textField()); } }; } [B]private[/B] TextItem textField() { [B]return[/B] [B]new[/B] TextItem() { { setTitle("Text"); setTextBoxStyle("TextBoxStyle"); } }; } }
Code:
[I].TextBoxStyle[/I] { background: [I]red[/I]; } [I].TextBoxStyleFocused[/I] { background: [I]blue[/I]; } [I].TextBoxStyleOver[/I] { background: [I]orange[/I]; }
- When the application is launched the TextItem background color is red. Based on the CSS, this is the expected behavior
- If I move the cursor over the TextItem there is no change to the background color. According to the CSS I would expect the background color to change to orange.
- When I click in the TextItem the background color changes to blue. Based on the CSS and the use of the “Focused” suffix, this is the expected behavior.
Comment