6 Replies Latest reply on Jan 20, 2010 1:58 PM by nathanbie

    Label showTruncationTip defaulting to false

    nathanbie
      The addition of the showTruncationTip to spark's Label is a welcome one, but defaulting it to false seems inconsistent with mx Label.  Will there be a way to default the spark labels property "showTruncationTip" to true? possibly through css?
        • 1. Re: Label showTruncationTip defaulting to false
          Peter deHaan Level 4

          @nathanbie,

           

          Actually, showTruncationTip is a property and not a style, so you couldnt use CSS. You could probably extend the s:Label class and change the default value to true instead though.

           

          Feel free to file a bug/enhancement at http://bugs.adobe.com/flex/ and request that the default value change from false to true. I'm not sure on the reasoning behind the current default value.

           

          Peter

          1 person found this helpful
          • 2. Re: Label showTruncationTip defaulting to false
            nathanbie Level 1

            Will do. Thanks Peter.

            • 3. Re: Label showTruncationTip defaulting to false
              Peter deHaan Level 4

              Actually, thanks to the rather useful links on the right, I found this checkin; http://forums.adobe.com/message/2409580#2409580

              It seems the current default is false because s:Label is often used in skin that have their own tooltip logic.

               

              Peter

              1 person found this helpful
              • 4. Re: Label showTruncationTip defaulting to false
                nathanbie Level 1

                Hmm, looks like either way,true or false, it will cause some issues. I take it there isn't an easy solution like setting labels within a skin to showTruncationTip="false"?

                 

                This will be frustrating on our multi lingual application. Maybe not on the same level of frustration as mx scrolling policy default to on, but still frustrating. We've already set all our datagrid item renderers to mx labels just so that could use the tooltip feature. I guess there is a benefit to having a project wide find and replace.

                 

                Outside of the annoyance of setting all our label's showTruncateTip to true, would doing so create a compile or runtime performance hit?

                 

                Thanks for the replies Peter.

                • 5. Re: Label showTruncationTip defaulting to false
                  Flex harUI Adobe Employee

                  Why isn't the default DG renderer's datatip sufficient?

                  • 6. Re: Label showTruncationTip defaulting to false
                    nathanbie Level 1
                    • Consistency between interaction with header and column text. Data tips are only applied to items and not to headers.
                    • Visual indicator, ellipsis, that shows the user the text is truncated.
                    • Label's tool tip won't obscure the line the user is hovering over.  Data tips are placed directly over the text.

                     

                    Example:

                     

                    <?xml version="1.0" encoding="utf-8"?>
                    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                                      xmlns:s="library://ns.adobe.com/flex/spark"
                                      xmlns:mx="library://ns.adobe.com/flex/halo"
                                      >
                         <fx:Declarations>
                              <!-- Place non-visual elements (e.g., services, value objects) here -->
                              <s:ArrayCollection id="dataAC"
                                                     >
                                   <fx:Object col1="Really long text that should truncate."
                                                col2="Really long text that should truncate."
                                                col3="Really long text that should truncate."
                                                col4="Really long text that should truncate."
                                                />
                                   <fx:Object col1="Really long text that should truncate."
                                                col2="Really long text that should truncate."
                                                col3="Really long text that should truncate."
                                                col4="Really long text that should truncate."
                                                />
                                   <fx:Object col1="Really long text that should truncate."
                                                col2="Really long text that should truncate."
                                                col3="Really long text that should truncate."
                                                col4="Really long text that should truncate."
                                                />
                                   <fx:Object col1="Really long text that should truncate."
                                                col2="Really long text that should truncate."
                                                col3="Really long text that should truncate."
                                                col4="Really long text that should truncate."
                                                />
                              </s:ArrayCollection>
                         </fx:Declarations>
                    
                         <mx:DataGrid width="350"
                                         dataProvider="{dataAC}"
                                         >
                              <mx:columns>
                                   <mx:DataGridColumn headerText="PLAIN: Really long text that should truncate."
                                                          dataField="col1"
                                                          />
                                   <mx:DataGridColumn headerText="DATA TIPS: Really long text that should truncate."
                                                          dataField="col1"
                                                          dataTipField="col1"
                                                          showDataTips="true"
                                                          />
                                   <mx:DataGridColumn headerText="LABELS: Really long text that should truncate."
                                                          dataField="col4"
                                                          headerRenderer="mx.controls.Label"
                                                          itemRenderer="mx.controls.Label"
                                                          />
                              </mx:columns>
                         </mx:DataGrid>
                    </s:Application>