Page 1 of 3 123 LastLast
Results 1 to 10 of 28

Thread: Problem with Buttons and setStyleName

  1. #1

    Default Problem with Buttons and setStyleName

    HI, all I'm new at gxt and i have a problem with the Button-Widget and SetStyleName.

    Here is the Code :

    Code:
    import com.extjs.gxt.ui.client.widget.button.Button;
    // import com.google.gwt.user.client.ui.Button;
    import com.google.gwt.core.client.EntryPoint;
    import com.google.gwt.user.client.ui.RootPanel;
    
    /**
     * Entry point classes define <code>onModuleLoad()</code>.
     */
    public class Test implements EntryPoint {
    
        public void onModuleLoad() {
            Button bTest=new Button("Test");
            bTest.setStyleName("myButton");
            RootPanel.get("inhalt").add(bTest);
        }
    }
    and the CSS:

    Code:
    .myButton {
     background-image: none;
     background-color: white;
     color : black;
     border : none;    
    }
    
    .myButton:hover {
      background-image: none;
      border:none;    
    }
    If I take the Button from the GWT it works perfekt. When I use the gxt-Button the CSS will be ignored.

    Where is my mistake?

    Thanks

  2. #2
    Sencha Premium Member
    Join Date
    Sep 2007
    Posts
    13,976

    Default

    Inspect the button with firebug and see whats wrong with your styling.

  3. #3

    Default

    I can't see an error.

  4. #4

    Default

    BUG ?????!!!!

    I analysed it with firebug again and I found something.

    I found my Styledefinition in the Table declaration wich wrapps the Button.

    The Style of the Button is "x-btn-text". I think this ist not correct.

  5. #5

    Default

    Try using addStyleName instead of setStyleName.
    This is not a bug. I've asked that before. Now setStyleName is for Images bundling.

  6. #6
    Sencha Premium Member
    Join Date
    Sep 2007
    Posts
    13,976

    Default

    setStyleName is not for imagebundle and this is also not a bug. Try to explain in detail what you want do to

  7. #7

    Default

    AddStyleName makes no Difference

  8. #8

    Default

    AddStyleName makes no Difference

  9. #9

    Default I have a similar problem with the Button styling

    Hey,

    Continuing what has been started here -
    I'm trying to instantiate a GXT button with text but it just shows the text (and in the GWT shell it's not displayed at all...). I've tried to do it as simple as possible :
    Code:
            myLoginForm.addButton(new Button("Login"));
    The CSS class is x-btn-text...

    Any ideas ?
    Guys

  10. #10
    Sencha Premium Member
    Join Date
    Sep 2007
    Posts
    13,976

    Default

    Are you using the latest css and iamges from the GXT2 release?

Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •