I am new to laszlo,  i have one doubt. can any one please help me.
Brief of Application:
I am trying to use javarpc with a JDBCjava program and exequte
Query on Mysql Database, the result is Written to a file  say productlist.xml in server.

laszlo app will read data from this file throught dataset.

My question is: (code below)

canvas has two button
if i press button 1 title Dogs. the method sends query and executed and write data in file productlist.xml.
then called the class NewView to display the content of file. for first time data in populated in the View.


but when button 2 title Cats is pressed with next query. The method sends new query and executed and write
data in the same file productlist.xml. Now when called the class NewView to display the content of updaed file
it is shows previous data. though the file is uodated with new data.

How to update view or reload the dataset/datapath to bind new dataset every time i call the class NewView????


Thanks in Advance
Regards,
bintu

<canvas>
  <dataset     name="myDataPrd"
                        src=""
                        type="http"
                        request="true"/>
                       
  <javarpc.....>
         :
         :
  </javarpc>
      
  < button text="Dogs" >
 
      <remotecall name="getPrdQueryInfo" funcname="getPrdQueryInfo"
                                                             remotecontext="$once{ ce }">
        <param>
         <method name="getValue">
         return 'select productid, name from product where category="DOGS"';
      </method>
     </param>
       </remotecall>
  
       <method event="ondata" args="res">
           Debug.write("return type:", typeof(res))
   
        new NewView();
       
       </method>
  
   </button>
      
   %similarly another button
  
   <button text="Cats" ...
         : 
           query for CATS
  
           new NewView();
         :
  </button>
      
     <class name= "NewView">
         <method event="oninit">
            var dset = new LzDataset( null, { name: 'dset',
                                                  src: 'http://localhost:8080/lps-3.1/temp/productlist.xml',
                                                      request: 'true' } );
                                             
             rowOfData.setDatapath('dset:/myXML/product/');
        Debug.write( dset);
         </method>
   
    <view name="rowOfData" datapath="myDataPrd:/myXML/product/
    <text datapath="productcode/text()" />
    <text datapath="productname/text()" />
  </class>
      
</canvas>
     
When button 1 press it works fine


---------- Laszlo Dubugger Output----------
method: null
return type: string
return value: Query= select productid, name from product where category="CATS"
writing to file: productlist.xml <myXML> <product>  <productcode>FL-DLH-02</productcode>  <productname>Persian</productname> </product> <product>  <productcode>FL-DSH-01</productcode>  <productname>Manx</productname> </product></myXML>
«LzDataset#2| <dset/>»
---------- ---------- ----------

But when button 2 press this below warning message comes. and populates the view with the above data.
(Note:- though the data file has changed. With each press of button data file is changing)

---------- Laszlo Dubugger Output ----------
method: null
return type: string
return value: Query= select productid, name from product where category="DOGS"
writing to file: productlist.xml <myXML> <product>  <productcode>K9-BD-01</productcode>  <productname>Bulldog</productname> </product> <product>  <productcode>K9-CW-01</productcode>  <productname>Chihuahua</productname> </product> <product>  <productcode>K9-DL-01</productcode>  <productname>Dalmation</productname> </product> <product>  <productcode>K9-PO-02</productcode>  <productname>Poodle</productname> </product> <product>  <productcode>K9-RT-01</productcode>  <productname>Golden Retriever</productname> </product> <product>  <productcode>K9-RT-02</productcode>  <productname>Labrador Retriever</productname> </product></myXML>
WARNING: A dataset already exists with the name 'dset': «LzDataset#2| <dset><myXML><product><productcode>FL-DLH-02</productcode><productnam...» - use explicit datasources in your datapaths.
«LzDataset#4| <dset/>»
---------- ---------- ----------


Any idea how to do ?      
   
======================= ===
Bintu G. Vasudevan

 


==========================
Bintu G. Vasudevan

Senior Research Fellow
MOG/RESIPA 6049
Space Application Centre ISRO
Ahmedabad India 

PH: (off.) +91-79-2691 6049
==========================


Yahoo! Photos – Showcase holiday pictures in hardcover
Photo Books. You design it and we’ll bind it!
_______________________________________________
Laszlo-user mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-user

Reply via email to