2012-05-01 26 views
0

我正在創建一個Flex表,其中一列是可編輯的。我想限制用戶的輸入到某些字符。以下代碼給出Could not resolve <s:itemEditor> to a component implementation錯誤。任何人都知道如何解決此問題?Flex:在火花表中實現TextInput限制給出錯誤

... 
<fx:Array> 
    <supportClasses:MyColumn ... /> 
    <supportClasses:MyColumn editable="true" ...> 
     <s:itemEditor> 
      <fx:Component> 
       <s:TextInput restrict="0-9a-zA-Z"/> 
      </fx:Component> 
     </s:itemEditor> 
    </supportClasses:MyColumn> 
    <supportClasses:MyColumn ... /> 
    ... 
</fx:Array> 
... 

凡MyColumn是一類和功能如下:

import spark.components.gridClasses.GridColumn; 
public class MyColumn extends GridColumn 
{ 
    ... 
    public function MyColumn(headerText:String="header" width:Number=100 ...) 
    { 
     this.headerText=headerText; 
     ... 
    } 
} 

回答

1

我找到了解決您的問題上this blog post.

的問題是,MXML編譯器會很困惑,當命名空間唐不匹配(supportClasses:s:)。修復非常簡單:

<supportClasses:MyColumn editable="true" ...> 
    <supportClasses:itemEditor> 
     <fx:Component> 
      <s:TextInput restrict="0-9a-zA-Z"/> 
     </fx:Component> 
    </supportClasses:itemEditor> 
</supportClasses:MyColumn> 
+1

@ggkmath啊。我想我可能會爲你解決問題。看看我編輯的答案。 –

+0

完美的作品 - 非常感謝Sam! :-) – ggkmath