1. #1
    Ext GWT Premium Member
    Join Date
    Aug 2011
    Location
    Germany
    Posts
    30
    Vote Rating
    0
    Ceene is on a distinguished road

      0  

    Question Answered: TextField.setStyleName("pflichtFelder") has no effect

    Answered: TextField.setStyleName("pflichtFelder") has no effect


    Hey all

    I have a problem with a TextField<String>.
    I tried to change the background in my project css file, but I don't get it.
    In my project.css is an entry ".pflichtFelder".
    Then in my code ist TextField.setStyleName("pflichtFelder");
    Wher is my mistake? I pray for help

  2. This is not about GWT or GXT. This is about how CSS works.

    Code:
    .pflichtFelder .x-form-text {    background-color: yellow; 
    background-image: none;
    }
    Code:
    textField.addStyleName("pflichtFelder");

  3. #2
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Answers
    60
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    In my project.css is an entry ".pflichtFelder".
    You missed the most important information. What is the content of ".pflichtFelder"?


    Then in my code ist TextField.setStyleName("pflichtFelder");
    You should use addStyleName in 99,99% of all cases.

  4. #3
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Answers
    60
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    I always suggest to use Firebug or IE Developer Tools. These tools will tell you always exactly why your styling has no effect.

  5. #4
    Ext GWT Premium Member
    Join Date
    Aug 2011
    Location
    Germany
    Posts
    30
    Vote Rating
    0
    Ceene is on a distinguished road

      0  

    Default


    Thanks for the reply

    I installed Firebug for Firefox 4 but I get no errors.

    I changed the the Code to TextField.addStyleName("pflichtFelder");
    But no change.
    In my project.css in the following entry
    Code:
    .pflichtFelder {
        background-color: yellow;
    }
    I don't know why the background of the TextField isn't yellow.

  6. #5
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Answers
    60
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    I installed Firebug for Firefox 4 but I get no errors.
    Why would you expect to get errors? With Firebug you can analyse what the correct rules would be.


    In your case it would be something like
    Code:
    .pflichtFelder .x-form-text {
        background-color: yellow; 
    }
    Please not that this is not related to GXT.
    There is a background image set too, which you probably want to remove.

  7. #6
    Ext GWT Premium Member
    Join Date
    Aug 2011
    Location
    Germany
    Posts
    30
    Vote Rating
    0
    Ceene is on a distinguished road

      0  

    Default


    Quote Originally Posted by sven View Post
    Please not that this is not related to GXT.
    There is a background image set too, which you probably want to remove.
    Ok if I understands you right there is a defaultName for the style in the gxt.css and this name I must override in the project.css?

  8. #7
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Answers
    60
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    Quote Originally Posted by Ceene View Post
    Ok if I understands you right there is a defaultName for the style in the gxt.css and this name I must override in the project.css?

    Not exatly. Altough there are default values, your rules gets assigned to the wrong element.

  9. #8
    Ext GWT Premium Member
    Join Date
    Aug 2011
    Location
    Germany
    Posts
    30
    Vote Rating
    0
    Ceene is on a distinguished road

      0  

    Default


    Sorry I don't get it (Steh gerade aufm Schlauch)
    In GWT the addStyleName-Method is to override the default-CSS-Style. You can use every name you like.
    If you say background-color:yellow; the background was yellow.

    In my GXT-application I have a LabelField with an other StyleName and there I have no problems.

    Which default-css-Names I must override that I get after die Dialog is load a yellow background?
    That is all I would like to get.

  10. #9
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Answers
    60
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    This is not about GWT or GXT. This is about how CSS works.

    Code:
    .pflichtFelder .x-form-text {    background-color: yellow; 
    background-image: none;
    }
    Code:
    textField.addStyleName("pflichtFelder");

  11. #10
    Ext GWT Premium Member
    Join Date
    Aug 2011
    Location
    Germany
    Posts
    30
    Vote Rating
    0
    Ceene is on a distinguished road

      0  

    Default


    Oh, I'm really sorry. I have not good knowlage in CSS.
    Thank for your help. Thank you very much.

    I will learn more about CSS.

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi