Hi,

I have been playing with your suggestions...

the xml-rpc function returns this XML (according to debug.write()..))
<element><item><item>1</item><item>Test 
Project</item></item><item><item>2</item><item>Ries test 
project</item></item><item><item>3</item><item>Klaas test 
project</item></item></element>

And currently My laszlo application looks like this:

<?xml version="1.0" encoding="UTF-8" ?>
<canvas width="800" height="350">

        
    <dataset name="me"><thedata /></dataset>
    <datapointer name="dp" xpath="me:/"/>
   
   

    <xmlrpc name="sqlSelect" service="http://127.0.0.1/~rvt/antshill/";>

        <handler name="onload">
            Debug.write('meerkat XML-RPC service loaded');
            Debug.write('proxy:');
            Debug.inspect(this.proxy);
        </handler>

        <handler name="ondata" args="retval">
            var el = LzDataElement.valueToElement(retval);
            Debug.write(el.serialize());
           
            element = dp.xpathQuery("thedata")
            element.appendChild (LzDataElement.valueToElement(retval))

        </handler>

        <handler name="onerror" args="error">
            Debug.write('onerror:', error);
        </handler>

        <remotecall name="gc" funcname="sql.select">
            <param value="'select * from projects'" />
        </remotecall>
    </xmlrpc>


    <window x="20" y="20" width="200" height="250" title="Simple Window" 
resizable="true">


     <simplelayout axis="y" spacing="10"/>


    <grid name="testGrid" datapath="me">
        <gridtext editable="false" datapath="@id" datatype="number">uid
        </gridtext>
        <gridtext datapath="@displayname" width="200">Project
        </gridtext>
    </grid>
   
    <button>
        Retreive Data
        <handler name="onclick" method="redify"/>   
        <method name="redify">sqlSelect.gc.invoke()</method>
    </button>
   
    </window>
</canvas>




The whole system doesn't return me any error but:

I have the following questions:

1) Is XML-RPC a good solution for CRUD operations on a database?
2) What could be wrong with the above, my grid doesn't get filled.
I know my datapath for gridtext is wrong, but I also don't have a clue 
where to set it to:
In PHP I would just call xml2array().. and voila I am there....
However in laszlo that will properly works different.

Is the XML returned correctly? (it is generated by the PHP XML-RPC library).

Ries

> You created a dataelement, you can attach that to a datapointer (by 
> doing an xpathquery against the pointer) and a datapointer can be 
> created from a dataset and a dataset can be created by <dataset 
> name="me">thedata/></dataset>
> So
> <dataset name="me">thedata/></dataset>
> <datapointer name="dp" xpath="me:/"/>
> <script>
> element = this.dp.xpathQuery("thedata")
> element.appendChild (LzDataElement.valueToElement(retval))
>
>
> On 10/5/06, *R. van Twisk* <[EMAIL PROTECTED] 
> <mailto:[EMAIL PROTECTED]>> wrote:
>
>     hey all,
>
>     I get data back from a xml-rpc call and my ondata look LIKE this:
>
>             <handler name="ondata" args="retval">
>                 var el = LzDataElement.valueToElement(retval);
>                 Debug.write(el.serialize());
>             </handler>
>
>
>     In my debug window I perfectly see the data coming from my request:
>
>     My grid component looks like this:
>       <grid id="test">
>         <gridtext editable="false" datapath="@id"
>     datatype="number">uid</gridtext>
>         <gridtext datapath="@displayname" width="200">Project</gridtext>
>       </grid>
>
>
>     Currently I am a bit lost on how to apply the data from
>     LzDataElement to
>     my grid.
>     I have take a look at teh grid examples, however they directly use
>     a XML
>     to retreive
>     data, while in my case I need to apply it to my grid.
>
>     Any pointers??
>
>     thanks,
>     Ries
>
>
>
>
>
>
>     _______________________________________________
>     Laszlo-user mailing list
>     [email protected] <mailto:[email protected]>
>     http://www.openlaszlo.org/mailman/listinfo/laszlo-user
>
>


-- 
Ries van Twisk
Freelance Typo3 Developer
email: [EMAIL PROTECTED]
web:   http://www.rvantwisk.nl/
skype: callto://r.vantwisk


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

Reply via email to