Announcement

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

    Over style has no effect on TextItem

    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:

    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");
                }
            };
        }
    }
    Here are the test CSS styles I’m using:

    Code:
    [I].TextBoxStyle[/I] {
         background: [I]red[/I];
    }
    [I].TextBoxStyleFocused[/I] {
        background: [I]blue[/I];
    }
    [I].TextBoxStyleOver[/I] {
        background: [I]orange[/I];
    }
    My results are:
    1. When the application is launched the TextItem background color is red. Based on the CSS, this is the expected behavior
    2. 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.
    3. 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.

    #2
    See FormItemBaseStyle - "Over" is not a supported suffix.

    This is a rarely requested type of styling, so we don't currently have roadmap plans to add it. It would be a valid Feature Sponsorship of it really matters to you.

    Comment


      #3
      Thank you for your response!

      I googled FormItemBaseStyle and found documentation “Interface FormItemBaseStyle (https://www.smartclient.com/smartgwt...BaseStyle.html).

      In this documentation it indicates the suffixes supported are:
      • Pending
      • Focused
      • Error
      • Disabled
      • RTL

      If this the definitive list?

      I have also found that for ButtonItem the suffix “Over” behaves as expected. If ButtonItem supports a different set of suffixes is there a list of suffixes supported by ButtonItem somewhere?

      Comment


        #4
        Yes, the docs are the definitive list.

        See the documentation for Button for states support by Buttons.

        Comment

        Working...
        X