开发者社区> 技术小胖子> 正文

Adding links to a Panel container’s status text in Flex

简介:
+关注继续查看

The following example shows how you can assign an HTML formatted string to a Panel container’s status text field using the getStatusTextField() method in the mx_internal namespace.

Full code after the jump.

 

Since this example uses the mx_internal namespace, you can’t always depend on this behavior to work in future versions of the Flex SDK. Use at your own risk.

<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2008/04/17/adding-links-to-a-panel-containers-status-text-in-flex/ -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout
="vertical"
        verticalAlign
="middle"
        backgroundColor
="white"
        creationComplete
="init();">

    
<mx:Script>
        
<![CDATA[
            import mx.core.IUITextField;
            import mx.controls.Alert;

            private function init():void {
                var tf:IUITextField = panel.mx_internal::getStatusTextField();
                tf.selectable = true;
                tf.addEventListener(TextEvent.LINK, textField_link);
                tf.htmlText = "status with <a href='event:showAlert'><u>link</u></a>";

            }

            private function textField_link(evt:TextEvent):void {
                Alert.show("Success! A Panel container with a link in the status text.", evt.text);
            }
        
]]>
    
</mx:Script>

    
<mx:Panel id="panel"
            title
="Title"
            status
="status with link"
            width
="320"
            height
="240">
        
<mx:Text text="Click the link in the Panel container's status bar to launch an Alert control."
                width
="100%" selectable="false" />
        
<mx:ControlBar>
            
<mx:Text htmlText="&lt;b&gt;Note:&lt;/b&gt; The status text field must have it's selectable property set to true in order to dispatch the link event."
                    width
="100%" selectable="false" />
        
</mx:ControlBar>
    
</mx:Panel>

</mx:Application>





    本文转自 OldHawk  博客园博客,原文链接:http://www.cnblogs.com/taobataoma/archive/2008/04/23/1167844.html,如需转载请自行联系原作者



版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。

相关文章
how is opportunity detail page display first item by default
how is opportunity detail page display first item by default
17 0
ng-repeat part1 - how UI is rendered from {{name}} to actual value
ng-repeat part1 - how UI is rendered from {{name}} to actual value
42 0
very important tip - when to add / in binding path Fiori
very important tip - when to add / in binding path Fiori
45 0
custom field further usage - add into UI and report
custom field further usage - add into UI and report
53 0
OPA 15 - find existing item by its type.note
Created by Wang, Jerry, last modified on Nov 08, 2015
67 0
How to find root cause of creation navigation failur
Created by Jerry Wang, last modified on Dec 09, 2014
65 0
How to find root cause of creation navigation failure
Created by Jerry Wang, last modified on Dec 09, 2014
41 0
SAP UI5 Nav container - how the inner control is added
Created by Wang, Jerry, last modified on May 18, 2015
55 0
sap.ushell.Container.getService("URLParsing") click tile using Ke's user
Created by Wang, Jerry, last modified on Jun 04, 2016
57 0
文章
问答
文章排行榜
最热
最新
相关电子书
更多
SECURING THE DATA CENTER IN A
立即下载
Why you should care about data layout in the file system
立即下载
Cloak-And-Dagger-From-Two-Permissions-To-Complete-Control-Of-The-UI-Feedback-Loop
立即下载