8 Replies Latest reply on Aug 21, 2006 12:30 AM by sobaka11

    errorTips view

    sobaka11
      I want to change view of my errorTips:

      .errorTip {
      color: #FFFFFF;
      fontSize: 9;
      fontWeight: "bold";
      shadowColor: #000000;
      borderColor: #CE2929;
      borderStyle: errorTipBelow;
      /* borderStyle: null;*/
      paddingBottom: 4;
      paddingLeft: 4;
      paddingRight: 4;
      paddingTop: 4;
      }
      </mx:Style>
      errorTip = ToolTipManager.createToolTip('sfdsdsd',0,0,0);
      errorTip.setStyle("styleName", "errorTip");

      When I use -borderStyle: errorTipBelow;- all is ok( tip has a 'tail'). I want to make my tips be without 'tail'( normal tip). When I use -borderStyle: null;- my tip has no color, there is only one tip-text without tip.
      How is it possible to make the tip be normal(without 'tail' and with color)?
        • 1. Re: errorTips view
          inlineblue Level 1
          If you don't want a "tail", then you don't want an errortip--you just want a regular tooltip, which is what you get by setting borderStyle to null. Just set the backgroundColor style to whatever you want.
          • 2. Re: errorTips view
            sobaka11 Level 1
            so, what should I change in my code?

            .errorTip {
            color: #FFFFFF;
            fontSize: 9;
            fontWeight: "bold";
            shadowColor: #000000;
            backgroundColor:#FFCC00;
            /* borderColor: #CE2929;*/
            /*borderStyle: errorTipBelow;*/
            borderStyle: null;
            paddingBottom: 4;
            paddingLeft: 4;
            paddingRight: 4;
            paddingTop: 4;
            }
            errorTip.setStyle("styleName", "errorTip");

            With this code only one text appears( instead of the tip)
            • 3. Re: errorTips view
              sobaka11 Level 1
              I have a button with errorstring:
              <mx:Button label="Button" errorString="kjlk"/>

              What code must be in CSS-file in order to make the tip's view as I've described?
              • 4. Re: errorTips view
                inlineblue Level 1
                Ok, here's my suggestion: If you don't want a tail, do not use errorTip. Use the regular toolTip. You can still set the colour and other styles:

                <mx:Style>
                ToolTip {
                color: #FFFFFF;
                backgroundColor: #ff0000;
                }
                </mx:Style>

                <mx:Button label="Button" toolTip="kjlk"/>
                • 5. Re: errorTips view
                  sobaka11 Level 1
                  But I have to make the tip be always at the right side of its target, and tooltip appears near cursor. There is a way to use ToolTipManager to create my own tips, but I don't know how to use ToolTipManager with StringValidator.

                  ?xml version="1.0"?>
                  <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml">

                  <mx:Model id="membership">
                  <stringInfo>
                  <username>{userNameInput.text}</username>
                  <fullname>{fullNameInput.text}</fullname>
                  </stringInfo>
                  </mx:Model>

                  <mx:Form id="membershipForm">
                  <mx:FormItem id="fullNameItem" label="Full Name">
                  <!-- Not validated -->
                  <mx:TextInput id="fullNameInput"/>
                  </mx:FormItem>
                  <mx:FormItem id="userNameItem" label="Username">
                  <mx:TextInput id="userNameInput"/>
                  </mx:FormItem>
                  </mx:Form>

                  <mx:StringValidator source="{userNameInput}" property="text" minLength="6" maxLength="12"/>
                  </mx:Application>

                  The tips appear at the right side of the textfields but they have a tail!
                  • 6. Re: errorTips view
                    sobaka11 Level 1
                    One more question: is it possible to make background-gradient-color for a tooltip?
                    • 7. Re: errorTips view
                      inlineblue Level 1
                      My advice is to simply live with the tail, cause that's just the default look of errortips. Otherwise, you'll have to do extra work. If you're using the StringValidator, then you have to write a handler for its "invalid" event. In the handler, you'll have to determine which field failed validation and then create and position your own tooltip using the ToolTipManager. I can't help you with any of the details as I've no experience in that.
                      • 8. Re: errorTips view
                        sobaka11 Level 1
                        Can anyone advise me how to write a handler for event, when ,for example, textstring in one of my textfields is too short?