[Laszlo-user] Sending dataset over HTTP
Peter Brand
peter.brand at eines-alles-nichts.org
Sun Oct 21 11:32:06 PDT 2007
... the other way round: LZX inside XHTML, where data traffic between app
and datasource is between XHTML and datasource. The tiny data transfer (1)
from XHTML into LZX is via querystring (something like
.../laszlo_app.lzx?lzt=html&variable=value), (2) from LZX out to XHTML
again via querystring (something like .../XHTML_App.html?variable=value)
using a freely downloadable javasript function to grab the data from within
the html-page (see attachement).
-----Original Message-----
From: laszlo-user-bounces at openlaszlo.org
[mailto:laszlo-user-bounces at openlaszlo.org] On Behalf Of Jean-Baptiste
BRIAUD
Sent: Saturday, October 20, 2007 7:32 PM
To: Laszlo-user at openlaszlo.org
Subject: Re: [Laszlo-user] Sending dataset over HTTP
I misunderstood that point, it's interesting, how do you handle that ?
How do you use XHTML inside LZX for data transfer ?
Are you using <HTML> tag ? If yes, what do you put inside for data transfer
?
Peter Brand wrote:
> ... to be (more) precise: I switch from LZX to XHTML just when it
> comes to data transfer from applications (comprising embedded LZX) to
data sources.
> In many other cases I extensively use LZX; it's great pleasure (as you
> may have seen from my website www.eines-alles-nicht.org or from the
> following small application for my grandchild:
> http://www.eines-alles-nichts.org/Niels/Spiel.html).
>
> Regards
>
> -----Original Message-----
> From: Jean-Baptiste BRIAUD [mailto:jb at briaud.net]
> Sent: Saturday, October 20, 2007 12:59 PM
> To: Peter Brand
> Subject: Re: [Laszlo-user] Sending dataset over HTTP
>
> OK, but I really need LZX, XHTML is not equivalent and I need the
> power of LZX for the end user experience.
> Peter Brand wrote:
>
>> Hi Jean-Baptiste
>>
>> Sorry, I didn't realize that in your codeline:
>> ds.setAttribute("src", "test/nimportequoi"); 'nimportequoi' stands
>> for the URL of some Java servlet.
>> When trying something similar using php on the server-side (along the
>> lines of chapter 35) I failed - and meanwhile switched from LZX to
XHTML.
>>
>> Regards
>> Peter
>>
>> -----Original Message-----
>> From: laszlo-user-bounces at openlaszlo.org
>> [mailto:laszlo-user-bounces at openlaszlo.org] On Behalf Of
>> Jean-Baptiste BRIAUD
>> Sent: Friday, October 19, 2007 9:42 PM
>> To: Laszlo-user at openlaszlo.org
>> Subject: Re: [Laszlo-user] Sending dataset over HTTP
>>
>> Peter Brand wrote:
>>
>>
>>> Hi Jean-Baptiste
>>>
>>> According to my knowledge of OpenLaszlo socalled data-binding via
>>> the
>>>
>>>
>> 'src'
>>
>>
>>> attribute of 'dataset' is in fact not data-binding but just
>>> data-bound data-retrieval. It's a one-way functionality. Isn't it?
>>>
>>>
>>>
>>>
>> Binding via src ? What do you mean ?
>> I'm using xpath on widget with datapath attribute, not src at all...
>>
>>
>>
>>> And again according to my understanding of Laszlo things to
>>> udate/delete/insert data to the 'src' you have to call some server
>>> side program (php, jsp, asp, etc) that can handle data sources (e.g.
>>> a XML-file, a relational DB).
>>>
>>>
>> That's exactly what I'm doing : servlet = java server side.
>>
>>
>>
>>> Did you read chapter 35: Building Data-Driven Applications in the
>>> software egnineer's guide?
>>>
>>>
>>>
>> Yes.
>>
>>
>>> Peter
>>>
>>>
>>>
>>>
>>>
>>> -----Original Message-----
>>> From: laszlo-user-bounces at openlaszlo.org
>>> [mailto:laszlo-user-bounces at openlaszlo.org] On Behalf Of
>>> Jean-Baptiste BRIAUD
>>> Sent: Friday, October 19, 2007 12:50 PM
>>> To: Laszlo-user at openlaszlo.org
>>> Subject: [Laszlo-user] Sending dataset over HTTP
>>>
>>> Hi the list !
>>>
>>> I would like to send over HTTP the content of a dataset. Nothing
>>> complex ins't it ?
>>> But I got problems ... Let me explain :
>>> <dataset name="PetCreate1_pet_embeded_ds">
>>> <pet
>>> animal="aaa"
>>> entryDate="aaa"
>>> dateBirth="aaa"
>>> age="aaa"
>>> name="aaa"
>>> sex="aaa"
>>> streetNumber="aaa"
>>> streetName="aaa"
>>> code="aaa"
>>> town="aaa"
>>> </pet>
>>> </dataset>
>>>
>>> That dataset if mapped via xpath to different text field. (that
>>> dataset do not come from HTTP but is hardcoded like that in the lzx.
>>> Here is the code I use to send the dataset :
>>> <handler name="onclick">
>>> var ds = PetCreate1_pet_embeded_ds;
>>> Debug.write("Seding data ...");
>>> ds.setAttribute("querytype", "POST");
>>> ds.setAttribute("type", "http");
>>> ds.setAttribute("request", "false");
>>> ds.setAttribute("src", "test/nimportequoi");
>>>
>>> //var param = new LzParam();
>>> //var xml = ds.getPointer().serialize();
>>> //Debug.write(xml);
>>> //param.addValue("xml", xml, true);
>>> //ds.setQueryString(param);
>>> ds.doRequest();
>>> </handler>
>>>
>>>
>>> As you can see I try different thing to pass the XML.
>>> I have to explicitly add xml string as a param if I want to catch it
>>> on the Servlet.
>>> In other words, with that commented version, no XML on the servlet !
>>> Why ?
>>>
>>>
>>> In other part of my program I got on the servlet the following error :
>>> 2007-10-19 12:21:06.076::WARN: /petshop/:
>>> java.net.MalformedURLException: no protocol: <localdata/>
>>>
>>> or depending on some line commented or not, 2
>>> 2007-10-19 12:21:06.076::WARN: /petshop/:
>>> java.net.MalformedURLException: no protocol: <here all the dataset
>>> XML>
>>>
>>> So I got the XML but with that error everytime.
>>>
>>>
>>> Any clues ?
>>>
>>> thanks !
>>>
>>>
>>>
>>>
>>>
>>>
>>
>>
>>
>
>
>
>
More information about the Laszlo-user
mailing list