4 Replies Latest reply on May 13, 2010 2:09 PM by toft

    clearStyle

    toft Level 1

      When calling this function the target component is sometimes immediately on screen updated and sometimes not. What can be done to get an update every time ?

        • 1. Re: clearStyle
          TeotiGraphix Level 3

          Hi,

           

          clearStyle() just erases an override in the CSSStyleDeclaration set using setStyle(). A lot of component implement styleChanged() where they can adjust there view based on the styleProp parameter.

           

          Some components invalidate the component in this method, if they do you will not see an update immediatly. For situations where you don't see updates and want them right off call;

           

          myComponent.clearStyle("myStyle");
          myComponent.validateNow();
          

           

          Mike

          • 2. Re: clearStyle
            toft Level 1

            Thanks Mike

             

            However, for some reason it doesnt work.

             

            textarea_target.clearStyle("bottom");

            textarea_target.validateNow();

             

            This code doesnt update the textarea.

             

            Note! In my setup I set many styles in a series of calls. I have also tried textarea_target.validateNow() after the calls but it still doesnt work.

             

            What to do ??

            • 3. Re: clearStyle
              TeotiGraphix Level 3

              Hi,

               

              I'm not quite sure but since the style bottom has to do with the display list and measurement, you might need;

               

               

              textarea_target.clearStyle("bottom");
              textarea_target.invalidateSize();
              textarea_target.invalidateDisplayList();
              UIComponent(textarea_target.parent).validateNow();
              

               

              Mike

              • 4. Re: clearStyle
                toft Level 1

                Thanks again Mike

                 

                I think I`ve found a solution. When the baseline style is undefined the bottom update doesnt work. When baseline is set to a value the bottom update works (event without calling validateNow). It seems some styleproperties depend on others being defined for them to work