Why not have the zone id stored in a
variable in your Application and then use binding to assign it through to your
components? When the selection changes simply update the value in the Application
and everything will propagate through? Make sure that you cast your application
appropriately so everyone knows what’s going on: {NoeveauProject(Application.application).selectedZoneID}
You could also look into a concept like a
ModelLocator that frameworks like Cairngorm suggest, but if you’re really
close this kind of technique should get you there.
Matt
In our apps, we would like to refresh all the values in all related
forms based on a selected ID from a list.
Each time we select a
zone ID, all the children components must change
their values. I
haven't figured out how to do so. Can you please
help me…I feel that
I must use the Dispatching but I don't get it yet
on how to trigger
a function in each component.
Here is the structure of the files.
NouveauProjet.mxml (this is the main apps)
<mx:Application……>
<mx:ViewStack
id="vsl">
<EEfrm:zone_hallPEBC
projectID="{projID}"
id="zone_hallPEBC"
zoneGenID="{zoneGenID}" target="{this}"/>
<EEfrm:zone_hallMainPEBC
id="zone_hallMainPEBC"/>
….
zone_hallPEBC.mxml
<mx:VBox….>
function
accessZone(choixZone:Object){
_global.tempZone = choixZone;
target.vsl.selectedIndex = 35;
}
<mx:List
id="zones" width="100%" height="100%"
dataProvider="{ecranRO.affichage.result}"
labelField="Description"
borderStyle="solid"/>
<mx:Button
id="accederButton" label="Accéder à la zone"
click="must go to page and refresh all the
values for all the
viewStacks"/>
zone_hallMainPEBC.mxml
<mx:VBox…..>
function initApp(){
ecranRO.affichage(_global.tempZone.Building_Zone_ID);
}
…..
<mx:RemoteObject
id="ecranRO"…>
<mx:method name="affichage" >
<mx:arguments>
<zoneID>{choixZone.ZoneID}</zoneID>
</mx:arguments>
</mx:method>
</mx:RemoteObject>
<mx:Accordion id="myAccordion"
width="100%" height="100%" >
<mx:TabNavigator
label="Enveloppe">
<EEfrm:MursExtPEBCFrm
id="MursExtPEBCFrm"
zoneID="{_global.tempZone.Building_Zone_ID}"
/>
<EEfrm:FenestrationPEBCFrm
id="FenestrationPEBCFrm"
zoneID="{_global.tempZone.Building_Zone_ID}"/>
<EEfrm:ToiturePEBCFrm
id="ToiturePEBCFrm"
zoneID="{_global.tempZone.Building_Zone_ID}"/>
</mx:TabNavigator>
<mx:TabNavigator
label="Équipements">
<EEfrm:EclairagePEBCFrm
id="EclairagePEBCFrm"
zoneID="{_global.tempZone.Building_Zone_ID}"
/>
<EEfrm:CuissonPEBCFrm
id="CuissonPEBCFrm"
zoneID="{_global.tempZone.Building_Zone_ID}"/>
<EEfrm:EvacuaPEBCFrm
id="EvacuaPEBCFrm"
zoneID="{_global.tempZone.Building_Zone_ID}"/>
</mx:TabNavigator>
<EEfrm:CVCAPEBCFrm id="CVCAPEBCFrm"
zoneID="{_global.tempZone.Building_Zone_ID}"
label="CVCA"/>
<EEfrm:RegulationPEBCFrm id="RegulationPEBCFrm"
zoneID="{_global.tempZone.Building_Zone_ID}"
label="Régulation"/>
</mx:Accordion>
MursExtPEBCFrm & FenestrationPEBCFrm &
ToiturePEBCFrm &
EclairagePEBCFrm & CuissonPEBCFrm &
EvacuaPEBCFrm & CVCAPEBCFrm &
RegulationPEBCFrm
<VBox….>
function initApp(){
ecranRO.affichage(_global.tempZone.Building_Zone_ID);
}
…… .
<mx:RemoteObject
id="ecranRO"…>
<mx:method name="affichage" >
<mx:arguments>
<zoneID>{choixZone.ZoneID}</zoneID>
</mx:arguments>
</mx:method>
</mx:RemoteObject>
<mx:TextInput
text="{ecranRO.result.input1}">
…….
Thanks for any help.
--- In [email protected],
"Matt Chotin" <[EMAIL PROTECTED]>
wrote:
> You're gonna have to provide more information
than this. Give
everyone
> ids and you'll be able to reach them by
dotting down.
>
>
>
> <comp1:myComp1 id="mc1" />
>
>
>
> <Subcomp2:mySubComp2 id="msc2"
/>
>
>
>
> mc1.msc2.dispatchEvent({type:
"change"});
>
>
>
> ________________________________
>
> From: [email protected]
[mailto:[email protected]]
On
> Behalf Of Ghislain Simard
> Sent: Saturday, July 30, 2005 10:55 AM
> To: [email protected]
> Subject: [flexcoders] broadcasting to a
sub-component
>
>
>
> How to broadcast an event to a component
inside a component?
>
> main.mxml
> <comp1:myComp1/>
>
> myComp1.mxml
> <Subcomp2:mySubComp2/>
>
> mySubComp2.mxml
>
>
>
>
> --
> Flexcoders Mailing List
> FAQ:
http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Search Archives:
> http://www.mail-archive.com/flexcoders%40yahoogroups.com
>
>
>
>
> ________________________________
>
> YAHOO! GROUPS LINKS
>
>
>
> * Visit your
group "flexcoders
> <http://groups.yahoo.com/group/flexcoders>
" on the web.
>
> * To
unsubscribe from this group, send an email to:
>
[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]
subject=Unsubscribe>
>
> * Your use of
Yahoo! Groups is subject to the Yahoo! Terms of
> Service <http://docs.yahoo.com/info/terms/>
.
>
>
>
> ________________________________
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
YAHOO! GROUPS LINKS
|
- RE: [flexcoders] Re: broadcasting to a sub-component Matt Chotin
-