[Laszlo-user] Sending dataset over HTTP

Jean-Baptiste BRIAUD jb at briaud.net
Fri Oct 19 12:42:01 PDT 2007


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