Announcement

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

    add multiple style in SmartGwt

    Hello,
    I use SmartGwt and I need to add a style to an element and not a setStyleName ... I want to add a style like in GWT base.
    I'm looking for the equivalent of addStyleName GWT in SmartGwt.
    thanks..;)

    #2
    Read carefully through the javadocs for setStyleName(), it does the same thing.

    Comment


      #3
      Hi, and thanks for your reply.
      i had seen in the JavaDoc of smartGwt about addStyleName in a canvas...but it does the same thing as a setStyleName..in the interior of addStyleName method you will found a setStyleName and not an addStyleName.
      if you have already seen this problem I would like to have a diversion.
      thanks ;)

      Comment


        #4
        addStyleName() is equivalent to setStyleName(getStyleName() + " styleOther"); thus use setStyleName() and just append to it. You could easily write a wrapper function to call as well.

        Comment


          #5
          To make clear what is in SmartGwt, here is the method in the Canvas class addStyleName
          Code:
          /**
               * Multiple styles are currently not supported. This method essentially calls {@link #setStyleName(String)}
               *
               * @param style the style name
               * @see #setStyleName(String)
               */
              public void addStyleName(String style) {
                  setStyleName(style);
                  com.google.gwt.core.client.GWT.log("addStyleName is not supported. Calling setStyleName instead", null);
              }

          Comment


            #6
            Right, so you can just write your own wrapper like I described below, which causes styles to append it will do the trick. Removing them will require parsing the string though.

            Comment


              #7
              thanks for your help.;)

              Comment

              Working...
              X