[Laszlo-dev] Setting an resource to value of datapath

Henry Minsky henry.minsky at gmail.com
Mon Oct 31 19:19:23 PST 2005


In the demos/amazon app, there is an example of this, a view which shows
an image of a CD album cover, from an Amazon search. It sets its datapath
to the desired xpath, and then constrains the "source" attribute to the data
value.

The line

<attribute name="source" value="${this.data}"/>

does that.



<view name="cover" datapath="ImageUrlSmall/text()" y="7" width="50"
height="50" clip="true"
onmouseover="dragsmall.display(this, this.datapath.xpathQuery('text()'))"
onmouseout="dragsmall.hide()"
onmousedown="dragsmall.start()"
onmouseup="dragsmall.stop(); this.itemDropped(parent.datapath);"
ondblclick="this.parent.getInfo()">
<attribute name="source" value="${this.data}"/>
<method name="itemDropped" args="dpath">
if (dragsmall.droppedInView(cart.parent)) {
cart.addItem(dpath);
} else if (dragsmall.droppedInView(wish.parent)) {
wish.addItem(dpath);
}
</method>
</view>



On 10/31/05, Wolfgang Reinhardt <wolle at upb.de> wrote:
>
> Hi,
>
> i'm trying to set up the resource of a view by the result of an web
> service.
> The scenario is that i call an web service which generates a gif and
> returns the url to the generated picture. I am able to acces the url
> with a datapath..
>
> My problem now is how can i set the resource of an view dynamically
> to the url returned by the web service?
>
> Any ideas?
>
> regards,
>
> Wolle
> _______________________________________________
> Laszlo-dev mailing list
> Laszlo-dev at openlaszlo.org
> http://www.openlaszlo.org/mailman/listinfo/laszlo-dev
>



--
Henry Minsky
Software Architect
hminsky at laszlosystems.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://openlaszlo.org/pipermail/laszlo-dev/attachments/20051031/41187a48/attachment.html


More information about the Laszlo-dev mailing list