On Thu, Oct 28, 2010 at 11:32, Qoodary Doo <[email protected]> wrote:
> I have a little bit problem now with preparing the PHP content for the RPC:
>
Just to get the terminology correct, you're really not creating a remote
procedure call. You're just issuing an HTTP request and expecting an HTTP
response, but without the protocol definition of an RPC. (You're using the
low-level qx.io.remote.Request object directly, not the higher-level
qx.io.remote.Rpc object.) That not withstanding...
> For the simple model table I did it in this way:
>
> $recordset[] = array($color,$row['FileName'],$file_kb,$DateFormat );
> if(isset($recordset)){
> // JSON erzeugen
> echo json_encode($recordset);
> }
>
> Now for the remote model I try:
>
> $recordset[] =
> "{state:$color,filename:$row[FileName],filesize:$file_kb,date:$DateFormat}";
> if(isset($recordset)){
> // JSON erzeugen
> echo json_encode($recordset);
> }
>
Right. You're trying to hand-format JSON, and then call the JSON formatter
to re-format it.
Instead, you want a PHP object, or more likely, just an associative array,
containing your data. I've been using lots of languages other than PHP
recently, but I think the syntax is like this:
$recordset[] = array("state" => $color,
"filename" => $row['FileName'],
"filesize" => $file_kb,
"date" => $DateFormat);
Now you can pass $recordset to the json formatter (encoder) and it'll be
something that the formatter knows how to deal with.
Derrell
------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel