View Full Version : accessing the page document model
tangollama
03-03-2003, 01:35 PM
I am writing a laszlo test application within an existing framework and am having trouble with a few issues.
The first is finding the necessary tags to use to create multiple objects within a canvas that can be dragged and dropped. Ideally, I'd like a layout that would keep them in line but allow you to drag them through the canvas and then "place" them once the mouse is unclicked
Also, I need to be able to access the DOM from the surrounding HTML page to set form vairables. Is this possible?
antun
03-03-2003, 01:53 PM
Hey tangollama
The first is finding the necessary tags to use to create multiple objects within a canvas that can be dragged and dropped.
I'm not sure exactly what you mean here. If you want to make an object draggable, use the dragstate tag:-
<view onmousedown="myDrag.apply()"
onmouseup="myDrag.remove()">
<dragstate name="myDrag" />
</view>
To create multiple objects that you can drag, you'll most likely write a class and instantiate it:
<class name="myDragger" onmousedown="myDrag.apply()"
onmouseup="myDrag.remove()">
<dragstate name="myDrag" />
</class>
<myDragger />
As for keeping them in line, if you want something really fancy you'll probably have to write your own layout. Have a look at the various layouts found in:-
WEB-INF\lps\components\utils\layouts
Layouts are just LZX files.
Also, I need to be able to access the DOM from the surrounding HTML page to set form vairables. Is this possible?
Yes, you can call JavaScript functions in the wrapper page by using the LzBrowser class:-
LzBrowser.loadURL ( "javascript:alert('hello world')" ) ;
... but I don't know if the browser will allow you to do this (for security reasons). Why exactly are you trying to set HTML form variables? You know that the LPS has a plethora of data features, right?
-Antun
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.