 |
 |
|
|
|
 |

11-19-2008, 10:53 PM
|
|
|
Passing data in paramaters
Ok I have this HTTPService, works fine. I have been passing hard-coded values
"A" and "B", but now I want to pass a value in a variable. I don't understand
the syntax though. I've tried a couple things with no luck. What is the
syntax (and where might I have been able to find it I couldn't find anything
like this on the help or web pages)
<mx:HTTPService id="SetPilot"
url="http://localhost/magic94scripts/mgrqcgi94.exe "
method="POST"
useProxy="false">
<mx:request>
<appname>NOBRAWeb</appname>
<prgname>SetPilot</prgname>
<arguments>param1, param2</arguments>
<param1>A</param1>
<param1>B</param1>
</mx:request>
</mx:HTTPService>
|

11-19-2008, 11:03 PM
|
|
|
Re: Passing data in paramaters
"Developer504" <webforumsuser@macromedia.com> wrote in message
news:gg25bp$5tv$1@forums.macromedia.com...
> Ok I have this HTTPService, works fine. I have been passing hard-coded
> values
> "A" and "B", but now I want to pass a value in a variable. I don't
> understand
> the syntax though. I've tried a couple things with no luck. What is the
> syntax (and where might I have been able to find it I couldn't find
> anything
> like this on the help or web pages)
>
> <mx:HTTPService id="SetPilot"
> url="http://localhost/magic94scripts/mgrqcgi94.exe "
> method="POST"
> useProxy="false">
> <mx:request>
> <appname>NOBRAWeb</appname>
> <prgname>SetPilot</prgname>
> <arguments>param1, param2</arguments>
> <param1>A</param1>
> <param1>B</param1>
> </mx:request>
> </mx:HTTPService>
>
<mx:HTTPService id="SetPilot"
url="http://localhost/magic94scripts/mgrqcgi94.exe "
method="POST"
useProxy="false">
<mx:request>
<appname>NOBRAWeb</appname>
<prgname>SetPilot</prgname>
<arguments>param1, param2</arguments>
<param1>{thing1}</param1>
<param1>{thing2}</param1>
</mx:request>
</mx:HTTPService>
Assuming thing1 and thing2 are bindable variables.
|

11-20-2008, 05:03 PM
|
|
|
Re: Passing data in paramaters
Ok thanks Amy that was simple enough!
I have another question now though. I have this executing, it runs on an
on-click event. It is calling my external app, and writing data to it just
fine. But then after it does that I get an error message 1090 "XML Parser
element is malformed"
The difference between this and my other WS calls, is that in this case I am
only setting a value I don't want any data back from the external app. I am
then going to call another Flex program SWF file to run a report so it opens in
a new window.
|

11-20-2008, 05:43 PM
|
|
|
Re: Passing data in paramaters
"Developer504" <webforumsuser@macromedia.com> wrote in message
news:gg453m$nav$1@forums.macromedia.com...
> Ok thanks Amy that was simple enough!
>
> I have another question now though. I have this executing, it runs on an
> on-click event. It is calling my external app, and writing data to it
> just
> fine. But then after it does that I get an error message 1090 "XML Parser
> element is malformed"
Possibly your back end page is sending back a response anyway.
|

11-20-2008, 06:07 PM
|
|
|
Re: Passing data in paramaters
[/quote]Possibly your back end page is sending back a response anyway.
[/q]
Perhaps. I changed it so it sent something back (even though I don't need
anything back) and now it works without any errors so no big deal I guess.
D.
|

11-20-2008, 07:53 PM
|
|
|
Re: Passing data in paramaters
Ok now I have another problem... a really strange one.
Flex seems to be doing some things out of order or something, it's sending the
wrong value.
I have this handler for my on-click event:
public function goUrlTFP(event:ChartItemEvent):void {
/* rptWebsite=ceDs.@rptUrl */
thing1=event.hitData.item.thing;
SetPilot.send();
rptWebsite="TurnData_PR.swf";
return navigateToURL(new URLRequest(rptWebsite))
}
Where "thing1" is a bindable variable used as the paramter being passed in my
HTMLmerge per above.
So that when the user clicks on one of the bars on my barChart, this is
supposed to do the following:
1) set the current value of the bar clicked on into 'thing1'
2) run the HTTPService call to write this value to my external App
3) navigate to the other SWF file which will interract with the external App
based on this value.
The problem is, instead of sending the value for the particular record the
client clicked on, it always sends the first record. But what is really
strange is, to debug this, I put a variable on the form to show what value was
in 'thing1', and it shows the correct value, (the value that they clicked on)
It seems like Flex is doing the call to the HTTPService before it has
set the variable, even though it's supposed to happen after based on the code I
wrote. Is this what is happening, and if so, what is the work-around for this?
D.
|

11-20-2008, 08:23 PM
|
|
|
Re: Passing data in paramaters
Scratch that it was a problem with my external app, this is working perfect now.
|

11-20-2008, 08:42 PM
|
|
|
Re: Passing data in paramaters
"Developer504" <webforumsuser@macromedia.com> wrote in message
news:gg4f38$6de$1@forums.macromedia.com...
> Ok now I have another problem... a really strange one.
>
> Flex seems to be doing some things out of order or something, it's sending
> the
> wrong value.
>
> I have this handler for my on-click event:
>
> public function goUrlTFP(event:ChartItemEvent):void {
> /* rptWebsite=ceDs.@rptUrl */
> thing1=event.hitData.item.thing;
> SetPilot.send();
> rptWebsite="TurnData_PR.swf";
> return navigateToURL(new URLRequest(rptWebsite))
> }
>
> Where "thing1" is a bindable variable used as the paramter being passed in
> my
> HTMLmerge per above.
>
> So that when the user clicks on one of the bars on my barChart, this is
> supposed to do the following:
>
> 1) set the current value of the bar clicked on into 'thing1'
> 2) run the HTTPService call to write this value to my external App
> 3) navigate to the other SWF file which will interract with the external
> App
> based on this value.
>
> The problem is, instead of sending the value for the particular record the
> client clicked on, it always sends the first record. But what is really
> strange is, to debug this, I put a variable on the form to show what value
> was
> in 'thing1', and it shows the correct value, (the value that they clicked
> on)
>
> It seems like Flex is doing the call to the HTTPService before it
> has
> set the variable, even though it's supposed to happen after based on the
> code I
> wrote. Is this what is happening, and if so, what is the work-around for
> this?
What is the data type of thing1?
|

11-20-2008, 09:13 PM
|
|
|
Re: Passing data in paramaters
It was a string, but this is fixed now don't worry about it.
|

11-20-2008, 09:13 PM
|
|
|
Re: Passing data in paramaters
It was a string, but this is fixed now don't worry about it.
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|