[2010.04.21 (수) 약비] FLEX 다중파일업로드 컴포넌트 제작관련, 자식컴포넌트에서 부모컴포넌트의 참조
1. My Application of FLEX, FileUploader's Hierarchically structure.
Application
forMePanel:customPanel <- customPanelSkin <- every Button(close, minimize, returnsize)'s skin, it is allready
customized by me.
ApplicationControlBar
ProgressBar
Spacer
HGroup
Spacer
Label
DropdownList
DataProvider
ArrayList
List : dataProvider-uploadQueue,private | itemRenderer-forMe.skins.normalRenderer(recreated Renderer)
Layout
TileLayout
Group
VGroup
HGroup
TextArea
HGroup
ButtonBar : dataProvider-Object:Array, find, releaseAllSelected, deleteSelectedItems,
deleteAllItems, uploadAllItems are contained this container. All of these Buttons are
used for all function of this upload component.
2. List's itemRenderer is completely seperated from parent component. therefor, it's parent component can not access this component(List's itemRenderer)'s properties, methods. but itemRenderer can access it's parent component or Application.
3. I tried to access the property of Application' uploadQueue(it is dataProvider of List's). but I can't access that property. when I try to access the property throuh parentApplication from List's itemRenderer(normalRenderer) at runtime, I meet a message "uploadQueue is not find at FileUploader". while few time is flow, I'm thrown into confusion. Clery, there is uploadQueue called Application's property. I can not find my mistake in everywhere.
4. but I find out very impotant fact, the access definition of public, private is assigned by private. and my custom itemRenderer, normalRenderer is completely seperated from main Application. therefor, I must assign public access definition to access the uploadQueue property form Application's child, seperated my normalRenderer. but I assigned private. it's a natural result.
5. another way, I try to use to access the uploadQueue, the Application's property, through the method. this method is assigned by public. and it's function is update the uploadQueue and refresh itself.