> I think using HTTPService is the older model for doing things.

No, you use it when you are not using FDS or do not have access to it or the money. ;-)

Don't feel bad, you are not alone and everybody is not an enterprise either.

See the ongoing 50 thread post on this in the last 3 days.

Peace, Mike



On 8/24/06, Michael Schmalle <[EMAIL PROTECTED] > wrote:
Hi,

I don't know if this helps or not but,

I use the change event in the textinput to update the model.

Then when you want to update to the server the model is current.

<mx:TextInput id="userName"
   text="{model.userName}
   change={model.userName = userName.text}"/>

then you can submit the model with userName VO to the server with out assigning anything.

Peace, Mike


On 8/24/06, Mike Anderson <[EMAIL PROTECTED]> wrote:

Thanks for that informative post -
 
I guess I shouldn't post such (not dumb) but simplistic questions - I know better than that :)
 
Since Flex 2.0 has added such intuitive new features - one of those being the ability to directly find a Value within a Grid or List control, without having to Iterate through the values inside a Loop, that DataBinding may have had some enhancements to it as well.
 
I think it would be neat, to have an optional type of Binding scenario - in which the data flows both ways automatically...
 
In my case, I will just take the most typical path, and create 2 sets of Binding Commands - one that assigns the ValueObject properties to all my controls, and one that assigns all my control properties to the ValueObject.  That should take care of any changes that are made in either direction...
 
I was just expecting too much, from the Binding features of Flex - and just have to continue to do it the traditional way...
 
Thanks again for all your help -
 
Mike


From: [EMAIL PROTECTED]ups.com [mailto:flexcoders@ yahoogroups.com] On Behalf Of Nate Hardt
Sent: Thursday, August 24, 2006 10:49 AM
To: [EMAIL PROTECTED]ups.com
Subject: Re: [flexcoders] Don't bindings work both ways??

Bind your outgoing data to a model and submit that to the server:

<mx:Model id="infoModel">
<info>
<text2>{text1.text}</text1>
<text2>{text2.text}</text2>
<info>
</mx:Model>

Send it to the server via an HTTPService:

<mx:HTTPService
id="saveAny"
method="POST"
url="" href="http://yourserver/process.a" target="_blank" >http://yourserver/process.a"
useProxy="false"
showBusyCursor="true">
</mx:HTTPService>

Send like this:
saveAny.send(infoModel);


Bind the incoming like this:

<mx:Form width="50%" height="100%">
<mx:FormHeading label="Standard Info"/>
<mx:FormItem label="Text 1">
<mx:TextArea id="text1" text="{generalInfo.lastResult.response.info.text1}"/>
</mx:FormItem>

<mx:FormItem label="Text 2">
 <mx:TextArea id="text2" text="{generalInfo.lastResult.response.info.text2}"/>
</mx:FormItem>

<mx:Form>

To a service like this:
<mx:HTTPService
    id="generalInfo"
    url="" href="http://yourserver/get" target="_blank" >http://yourserver/get"
    useProxy="false">
</mx:HTTPService>


I use php, here's how I return the data. I put everything in an associate array then output it with a function:

$row['text1'] = "some data";
$row['text2'] = "some more data";

print "<?xml version=\"1.0\" ?>\n";
print "<response>";
print namedAssocToXml('info', $out);
print "</response>";

function namedAssocToXml($rowname, $attributes) {
$output = "<$rowname>\n";
foreach ($attributes as $name => $value) {
if (is_array($value)) {
if (is_numeric($name)) {
$output .= namedAssocToXml('row', $value);
}
else {
$output .= namedAssocToXml($name, $value);
}
}
else {
$value = str_replace("<", "&lt;", $value);
$value = str_replace(">", "&gt;", $value);
if (is_numeric($name)) {
$output .= "<item>" . $value . "</item>\n";
}
else {
$output .= "<$name>" . $value . "</$name>\n";
}
}
}
$output .= "</$rowname>\n";
return $output;
}


I think using HTTPService is the older model for doing things. With FDS you can do a lot of cooler things, but hopefully that will get you started. 

Nate


On Aug 24, 2006, at 11:09 AM, Mike Anderson wrote:

I will jump back into the Docs right away, but in the meantime, is there a faster way to do this?
 
Or must I do it the traditional way, by systematically assigning the values to the ValueObject, just prior to sending the Variables over to the server?
 
i.e.
 
myValueObjectVO.propertyOne = textFieldOne.text;
myValueObjectVO.propertyTwo = textFieldTwo.text;
myValueObjectVO.propertyThree = textFieldThree.text;
 
Thanks in advance!
 
Mike


From: [EMAIL PROTECTED]ups.com [ mailto:flexcoders@yahoogroups.com] On Behalf Of Matt Chotin
Sent: Thursday, August 24, 2006 12:32 AM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Don't bindings work both ways??

No, binding is only one-way, you'll need to set up the 2-way yourself.

Matt


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com ] On Behalf Of Mike Anderson
Sent: Wednesday, August 23, 2006 9:56 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Don't bindings work both ways??

Hello All,

I have a Form with several fields - and those fields are all bound to a
ValueObject (using the Curly Braces method).

After doing my database calls, etc., my Form populates beautifully with
all the values. However, if I edit any of those fields on the Form, and
then send the same ValueObject back to the server, nothing is changed -
it's as if I didn't make any changes to the Form itself.

It was my understanding, that once a Binding Relationship is created,
that any changes (either in the Model itself, or the Fields that are
tied to the Model) will update in both directions.

Is this not true, or am I missing something?

Thanks all for your help,

Mike






--
What goes up, does come down.



--
What goes up, does come down. __._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Software development tool Software development Software development services
Home design software Software development company


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to