Ok.  I've finally solved this one.

POST is the problem.

It seems that in a SOLO app, if you have...

dataset2.setSrc(foo);
dataset2.setQueryType('POST');
dataset2.doRequest();

It doesn't work.

But leaving out setQueryType works...

dataset2.setSrc(foo);
dataset2.doRequest();


also, using GET works...

dataset2.setSrc(foo);
dataset2.setQueryType('GET');
dataset2.doRequest();





-----Original Message-----
From: William Krick [mailto:[EMAIL PROTECTED]
Sent: Friday, October 06, 2006 9:59 AM
To: Henry Minsky; Laszlo-User
Subject: Re: [Laszlo-user] dynamic loading of XML files into a dataset
-- isthis possible?


Henry,

I read your other post to the list regarding data loading in SOLO apps.

However, the problem I'm currently having loading an XML file in my SOLO has
nothing to do with security problems as far as I know.

The SOLO app (SWF) and data file (XML) are on the same server, located in
the same directory...

http://www.3feetunder.com/solo-deploy/

I am unable to use the LiveHTTPHeaders extension because it's not supported
on Firefox 2 RC1.

However, I have grabbed a log from Proxomitron that shows the file request
and the response... "405 Method Not Allowed".

I think it's a syntax problem when I'm setting the source on the dataset but
I'm not sure what it needs to be.

Maybe POST is required for SOLO mode?

Does this mean anything to you?...


+++GET+++
POST /solo-deploy/phonebook1.xml HTTP/1.0
Host: www.3feetunder.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1)
Gecko/20060918 Firefox/2.0
Accept:
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=
0.8,image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Cookie: __utma=38690849.530128067.1136393521.1136393521.1158335349.2;
IMAIL_TEST_COOKIE=test; IMAIL_SESS_KEY_1160142266-36481=J5flxMT0lRlotzc6
Content-type: application/x-www-form-urlencoded
Content-length: 30
Connection: keep-alive
Posting 30 bytes...

+++RESP+++
HTTP/1.0 405 Method Not Allowed
Date: Fri, 06 Oct 2006 13:51:34 GMT
Server: Apache Webserver
Allow: GET, HEAD, OPTIONS, TRACE
Keep-Alive: timeout=5, max=149
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html; charset=iso-8859-1
+++CLOSE+++



...
Bill





-----Original Message-----
From: Henry Minsky [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 04, 2006 7:03 PM
To: William Krick
Cc: Laszlo-User
Subject: Re: [Laszlo-user] dynamic loading of XML files into a dataset -- is
this possible?


Is the URL you are fetching from on the same server as the app was served
from? If not, the Flash (and DHTML) security model will cause the data load
to fail. In SWF, you can add a crossdomain.xml file to the server, in DHTML,
you cannot load data using the existing data loader. There are some plans to
introduce a JSON data loading facility in DHTML to get around this, but for
Flash, you must obey their cross domain security model.

If the file is coming from the same server as the app, you can use Firefox's
LiveHTTPHeaders to monitor what actual request is being made to the server,
this is often instructive.



On 10/4/06, William Krick <[EMAIL PROTECTED]> wrote:
I just tried my app below as a SOLO app and it doesn't work (using nightly
3.4.x from yesterday).

It works fine when run under the server.  Is there something special I have
to do to make it work in SOLO mode?



-----Original Message-----
From: Henry Minsky [mailto:[EMAIL PROTECTED]

Sent: Wednesday, October 04, 2006 6:23 PM
To: William Krick
Cc: Laszlo-User
Subject: Re: [Laszlo-user] dynamic loading of XML files into a dataset -- is
this possible?


 POST was just an example.

In the Legals build, there are some bugs fixed that allow POST of raw data
to work in SOLO mode now, for both swf and DHTML runtimes,  BTW.



On 10/4/06, William Krick <[EMAIL PROTECTED]> wrote:
Sweet.  That worked.  Thanks.

For some reason, I thought that it required an actual http URL.

It never occurred to me that it would work with loose files in the same
directory.

BTW, it doesn't seem to require setting the query type to POST.

Was there a reason you set the query type?

...

<canvas layout="axis:y">

  <dataset name="ds1" src="filelist.xml"/>
  <dataset name="ds2"/>

  <combobox editable="false">
    <textlistitem datapath="ds1:/files/file"
                  text="$path{'text()'}" value="$path{'@value'}" />
    <handler name="onselect">
      Debug.write("setting src on ds2 to: " + this.value);
      ds2.setSrc(this.value);
      ds2.doRequest();
    </handler>
  </combobox>

  <view datapath="ds2:/phonebook/employee">
    <simplelayout axis="x"/>
    <text datapath="firstName/text()"/>
    <text datapath="lastName/text()"/>
    <text datapath="phone/text()"/>
  </view>

</canvas>



-----Original Message-----
From: Henry Minsky [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 04, 2006 5:36 PM
To: William Krick
Cc: Laszlo-User
Subject: Re: [Laszlo-user] dynamic loading of XML files into a dataset -- is
this possible?


You can easily set the URL for a dataset and issue a new request.

For example a post request on dataset ds would be

            ds.setSrc(url);
                ds.setQueryType('POST');
ds.doRequest();




On 10/4/06, William Krick < [EMAIL PROTECTED]> wrote:
Is it possible to dynamically load XML files into a dataset at runtime?

This example illustrates what I'm trying to do.
The attached zip includes this example and three required XML data files.


<canvas layout="axis:y">

  <dataset name="ds1" src="filelist.xml"/>
  <dataset name="ds2"/>

  <combobox editable="false">
    <textlistitem datapath="ds1:/files/file"
                  text="$path{'text()'}" value="$path{'@value'}" />
    <handler name="onselect">
      Debug.write ("setting src on ds2 to: " + this.value);
       ds2.setAttribute('src', this.value);
    </handler>
  </combobox>

  <view datapath="ds2:/phonebook/employee">
    <simplelayout axis="x"/>
    <text datapath="firstName/text()"/>
    <text datapath="lastName/text()"/>
    <text datapath="phone/text()"/>
  </view>

</canvas>





_______________________________________________
Laszlo-user mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-user







--
Henry Minsky
Software Architect
[EMAIL PROTECTED]


_______________________________________________
Laszlo-user mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-user




--
Henry Minsky
Software Architect
[EMAIL PROTECTED]




_______________________________________________
Laszlo-user mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-user






--
Henry Minsky
Software Architect
[EMAIL PROTECTED]


_______________________________________________
Laszlo-user mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-user



_______________________________________________
Laszlo-user mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-user

Reply via email to