2010-03-30 51 views
0

我在Cairngorm框架中使用Flex。用Flex中的組件內部的值進行數據綁定

我有我這樣創建一個自定義組件:

<components:FriendSearchPaginator id="searchResultsPaginator" 
             paginationElement="{_model.findFriendsPaginationElement}" 
             visible="{_model.friendsSearchResultsPaginatorVisible}" /> 

凡findFriendsPaginationElement是模型定位器內: 公共變種

[Bindable] 
findFriendsPaginationElement:PaginationElement = new PaginationElement(); 

自定義組件裏面我有按鈕,使用findFriendsPaginationElement對象的屬性:

<s:Button id="previousButton" 
       label=" prev " 
       click="paginateSearchResults(false)" 
enabled="{_model.findFriendsPaginationElement.more_previous}"/> 

但我從Flex那裏得到一個警告,那就是綁定不會以這種方式工作,而且不會。它首次加載組件,但每次更改find​​FriendsPaginationElement時它都不會反映組件。你知道我該如何去做這件事嗎? (更改綁定變量中的值會更改組件內部元素的狀態?)

+0

「more_previous」變量標記爲可綁定嗎? – 2010-03-30 06:54:54

+0

是的,它是:\t \t [Bindable] \t \t public var more_previous:Boolean; – Tam 2010-03-30 07:00:29

回答

相關問題