flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Javier Guerrero GarcĂ­a <javi...@gmail.com>
Subject Re: Filtering the response from a CallResponder object
Date Wed, 26 Mar 2014 09:55:20 GMT
Well, sincerely I haven't used any of those, but I'm always in the opinion
that if the core provides it, using another framework in top of it just
makes things slower and harder to mantain :)

And believe me, generating a plain XML file in PHP according to a query on
a table is pretty straightforward, retrieving it via httpservice in Flex is
0 lines of code (just declare the HTTPservice, bind the request to your
parameters, and you're done forever), and if you can filter your lastResult
with E4X binding the E4X expression to any bindable variables in your code,
you'll get one piece of code that has ZERO lines of actionscript (just the
XML tags), that will work forever, and that you don't have to care about it
anymore :)

Something like (check syntax thoroughly, I'm writting all from the top of
my head):

<mx:HTTPService id="studentSrv" url="http://..../yourservice.php"
type="E4X">
        <mx:request>
            <id>{studentGrid.selectedItem.id}</id>
            <anyother>{whatever}</anyother>
        </mx:request>
</mx:HTTPService>

will always call "yourservice.php?id=<the_selected_id>&anyother=whatever"
each time you call studentSrv.send(). If yourservice.php returns the module
list for that given student ID, and you then bind
studentSrv.lastResult.modules.(@id!=selectedId} to your datagrid, any time
you call studentSrv.send() you get 100% FOR FREE:

1. urlencoding of the ID and ANYOTHER parameters, and one call to
yourservice.php with the parameters correctly encoded
2. Parsing of the XML response on studentSrv.lastResult, taking care of
everything
3. filtering of lastResult, acording to your E4X expression
4. triggering of the update in the datagrid, as result for a change in the
binded dataprovider (which includes the E4X expression)

All of it with 0 includes, 0 frameworks, 0 lines of code, and 0 compilation
error out of the box :) Cool, isn't it? ;)



On Wed, Mar 26, 2014 at 10:32 AM, SmileySnr <liam.odonnell@dit.ie> wrote:

> Thank you for your prompt response Javier.
>
> I have been using the Zend Framework to auto code php scripts with Wamp 2.4
> to provide the back end web and database. I have been reliant on what
> apacheflex and as3 can provide. I was hoping to find a solution within
> these
> rather than bringing in another language. Although,  the more I work within
> this environment, the more I find its lacking on information and control in
> this regard. I may resort to your more direct approach.
>
> Just one question: Would you recommend abandoning Zend Framework in favour
> of your more direct hands on E4X scripting approach?.
>
> Thanbks
> SmileySnr
>
>
>
> --
> View this message in context:
> http://apache-flex-users.2333346.n4.nabble.com/Filtering-the-response-from-a-CallResponder-object-tp5697p5701.html
> Sent from the Apache Flex Users mailing list archive at Nabble.com.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message