2012-02-23 3 views
0

구성 요소의 속성에 액세스하는 데 문제가 있습니다. 이 속성을 사용하여 특정 하위 구성 요소를 포함할지 여부를 결정하고 싶습니다.구성 요소 그리기 시간에 속성이 null입니까?

: MyMainView.mxml에는이 성분

<view:AnotherView id="anotherView" aPresenter="{thePresenter}"/> 

지금 AnotherView.mxml는 특성을 갖는다

<fx:Script><![CDATA[ 
    [Bindable] 
    public var aPresenter:APresenter; 
]]></fx:Script> 

하고이 AnotherView에서 .mxml 내가 뭔가를 추가 할 때 예 :

<s:Spacer height="10" includeInLayout="{aPresenter.id != -1}"/> 

aPresenter는 따라서 스페이서 상관없이 그려 얻을 여전히 null입니다. 반면에 나는 누군가가 나를 플렉스 컴포넌트의 생성과 어떻게에서 aPresenter 속성을 사용할 수 있습니다에 대한 이벤트의 흐름을 이해하는 데 도움 주실 래요

<mx:Repeater id="addressDetailsRepeaterView" dataProvider="{presenter.arrayOfFields}"> 
</mx:Repeater> 

작동하는 dataProvider에 대한 aPresenter를 사용하는 경우.

감사

+0

당신이 배치해야합니까' ... : MyMainView.mxml' 또는'AnotherView.mxml '에서' '? 또한'ThePresenter'가'MyMainView.mxml'에 선언 된 방법과 그 값을 어떻게 변경합니까? – sch

+0

라이프 사이클 문서를 읽으셨습니까? 이 http://livedocs.adobe.com/flex/3/html/help.html?content=ascomponents_advanced_2.html 및 http://help.adobe.com/en_US/flex/using/WS460ee381960520ad-2811830c121e9107ecb-7fff를 읽어보십시오. .html – JeffryHouser

+0

mx : Repeater는 MyMainView.mxml에없고, AnotherView.mxml에 있고, MyMainView.mxml의 thePresenter는 실제로 바인딩 가능하므로 AnotherView.mxml에서 사용할 수 있습니다. AnotherView.mxml 내의 것들 –

답변

0

시도 includeInLayout = "{aPresenter = 널 (null)!}"

관련 문제