Formats an eight-digit number to be split by a dash : SwitchSymbolFormatter « Data Model « Flex

Home
Flex
1.Chart
2.Components
3.Container
4.Data Model
5.Development
6.Effects
7.Event
8.Graphics
9.Grid
10.Style
Flex » Data Model » SwitchSymbolFormatterScreenshots 
Formats an eight-digit number to be split by a dash
Formats an eight-digit number to be split by a dash
  
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
    <mx:Script>
        
    import mx.formatters.SwitchSymbolFormatter;
    public var fmtSymbol:SwitchSymbolFormatter = new SwitchSymbolFormatter("#");
    public function formatMe(rawData:String):String
    {
        return fmtSymbol.formatValue("####-####",rawData);
    }
  
    </mx:Script>
    <mx:XML id="myData">
        <root>
            <item name="Fix something" id="1234567890" />
        </root>
    </mx:XML>
    <mx:Label text="Work Order: {formatMe(myData.item.@id)}" />
</mx:Application>

   
    
  
Related examples in the same category
1.Switch format string for SwitchSymbolFormatterSwitch format string for SwitchSymbolFormatter
2.Construct SwitchSymbolFormatterConstruct SwitchSymbolFormatter
w___w_w.___j_av_a2_s_.___c_o_m__ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.