Quantcast

io.remote.Request no response?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

io.remote.Request no response?

Simon Wong
I just write a simple io.remote program, but it is not work, please help.

I only receive the first alert, no second alert and alert(content), that
why the program can not enter the req.Listener? why?



button1.addEventListener("execute", function(e) {
 
        var req = new qx.io.remote.Request("dbtest.php", "GET",
"text/plain");
         alert("OK");
        req.addEventListener("completed", function(e) {
                                                   alert("OK");
                                                  var content =
e.getContent();
                                        alert(content);
                                                 
                                                   });
      });

In PHP:
<?php
echo "OK";
?>

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: io.remote.Request no response?

thron7
Simon Wong wrote:

> I just write a simple io.remote program, but it is not work, please help.
>
> I only receive the first alert, no second alert and alert(content), that
> why the program can not enter the req.Listener? why?
>
>
>
> button1.addEventListener("execute", function(e) {
>  
>         var req = new qx.io.remote.Request("dbtest.php", "GET",
> "text/plain");
>          alert("OK");
>         req.addEventListener("completed", function(e) {
>                                                    alert("OK");
>                                                   var content =
> e.getContent();
>                                         alert(content);
>                                                  
>                                                    });
>       });
>  

Mh, you need to send the request with "req.send()", don't you?!

T.

> In PHP:
> <?php
> echo "OK";
> ?>
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> qooxdoo-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>
>  


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: io.remote.Request no response?

Simon Wong

oh, yes, i forgot the send request, thanks thron 7.
Now, I want to response to json format, and apply the data to listview, but
it is a big problem with them.

When I run the page, I confirm that it can load all the data, and the
listview can show the data with its height only. it disappear the vertical
scroll bar, then i can not browser all the data with scrolling. and the
sorting function is not work...I try this morning and can not find out the
problem, can you help me? If there are any better way to do that, please let
me know!!

this is my code:

        var req = new qx.io.remote.Request("code/returnCompanyGrid.php",
"GET", qx.util.Mime.JSON);

                req.send();
                req.addEventListener("completed", function(e) {
                                                                               
                        var content = e.getContent();
                        for (var i=0; i<content.length; i++){
        ld.push({ id : { text : content[i].ID }, name : { text :
content[i].NameOfCompany }, office : { text : content[i].LocationOffice },
factory : { text : content[i].LocationFactory }, modified : { text :
content[i].ID }, rights: { text : content[i].ID }});
                                                                                                }
                                                                                                   });
        var lc =
        {
                  id : { label: "ID", width : 50, type : "text", sortable : true, sortProp
: "text"},
          name : { label : "Name of company", width : 300, type : "text",
sortable : true, sortProp : "text" },
          office: { label : "Location Office", width : 150, type : "text",
align : "right", sortable : true, sortProp : "text" },
          factory : { label : "Location Factory", width : 150, type :
"text", sortable : true, sortProp : "text" },
          modified : { label : "Manufacter", width : 150, type : "text" },
          rights : { label : "ID", width: 100, type : "text" }
        };
 
        var lv = new qx.ui.listview.ListView(ld, lc);

In php:
$query = $db->exequery("SELECT ID, NameOfCompany, LocationOffice,
LocationFactory FROM oem");
       
$returnArray = array();

while($row = mysql_fetch_array($query)){
array_push($returnArray, $row);
}

echo json_encode($returnArray);



thron7 wrote:

>
> Simon Wong wrote:
>> I just write a simple io.remote program, but it is not work, please help.
>>
>> I only receive the first alert, no second alert and alert(content), that
>> why the program can not enter the req.Listener? why?
>>
>>
>>
>> button1.addEventListener("execute", function(e) {
>>  
>>         var req = new qx.io.remote.Request("dbtest.php", "GET",
>> "text/plain");
>>          alert("OK");
>>         req.addEventListener("completed", function(e) {
>>                                                    alert("OK");
>>                                                   var content =
>> e.getContent();
>>                                         alert(content);
>>                                                  
>>                                                    });
>>       });
>>  
>
> Mh, you need to send the request with "req.send()", don't you?!
>
> T.
>
>> In PHP:
>> <?php
>> echo "OK";
>> ?>
>>
>> -------------------------------------------------------------------------
>> Check out the new SourceForge.net Marketplace.
>> It's the best place to buy or sell services for
>> just about anything Open Source.
>> http://sourceforge.net/services/buy/index.php
>> _______________________________________________
>> qooxdoo-devel mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>
>>
>>  
>
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> qooxdoo-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>

--
View this message in context: http://www.nabble.com/io.remote.Request-no-response--tp18108303p18126302.html
Sent from the qooxdoo-devel mailing list archive at Nabble.com.


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Loading...