you could prob do something like this text="{userSave/*BooleanValue*\ ?
photoFile : detailObject.Photo}
so just pass in a boolean in the event.
----- Original Message ----
From: JRBower <[EMAIL PROTECTED]>
To: [email protected]
Sent: Thursday, January 24, 2008 1:34:54 AM
Subject: [flexcoders] Dynamic Binding
I'm trying to change:
text="{photoFile} "
to
text="{this. detailObject. Photo}"
in this TextInput:
<c:TextInput
visible="false" includeInLayout= "false"
id="Users_Photo"
text="{photoFile} "
x="390" y="70"
width="240"
/>
after a user saves an uploaded photo.
The TextInput is part of a form where users upload a photo {photoFile}
dispatched via a <c:MyPhoto id="MePhoto"
dataShared=" photoFileHandler (event)" /> photo upload component which is
later displayed by binding {this.detailObject. Photo} to <mx:Image
id="myPhoto" source="applicantPi cs/{Users_ Photo.text} " />.
If //text="{photoFile} " remains after saving an uploaded photo, the photo
upload component reappears the next time I view the file.
What I need is //text="{photoFile} " to become
//text="{this. detailObject. Photo}" after the user saves.
Here's my code:
import flash.events. TextEvent;
[Bindable]
private var photoFile:String= "";
private function photoFileHandler( event:TextEvent) :void
{
photoFile=event. text;
}
private function newPhoto():void
{
myPhoto.visible = false;
myPhoto.includeInLa yout = false;
MePhoto.visible = true;
MePhoto.includeInLa yout = true;
}
<mx:Box x="390" y="70" borderStyle= "solid" borderThickness= "2"
borderColor= "#333333" >
<mx:Image id="myPhoto" source="applicantPi cs/{Users_ Photo.text} "
includeInLayout= "{(Users_ Photo.text. length == 0) ? false : true}"
visible="{(Users_ Photo.text. length == 0) ? false : true}"
width="105" height="140"
toolTip="{Users_ FirstName. text} {Users_LastName. text}"
doubleClickEnabled= "true"
doubleClick= "newPhoto( )"
/>
<c:MyPhoto id="MePhoto" x="390" y="70"
dataShared=" photoFileHandler (event)"
includeInLayout= "{(Users_ Photo.text. length == 0) ? true : false}"
visible="{(Users_ Photo.text. length == 0) ? true : false}"/>
</mx:Box>
<c:TextInput x="390" y="70"
visible="false" includeInLayout= "false"
id="Users_Photo"
text="{this. detailObject. Photo}"
width="240"
/>
<c:PhotoName myPhoto="{photoFile }" visible="false" includeInLayout= "false"/>
TIA
James
--
View this message in context: http://www.nabble. com/Dynamic- Binding-tp150599
94p15059994. html
Sent from the FlexCoders mailing list archive at Nabble.com.
____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now.
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ