[Laszlo-dev] designing API which is LZX
friendlyand Javascript-friendly
Don Hopkins
dhopkins at DonHopkins.com
Mon Nov 28 21:27:51 PST 2005
What are the advantages of dynamically creating user interface
components through xml data binding, instead of using a JavaScript api?
Ive been playing around with pie menus for Laszlo, trying to come up
with a Laszlish way to dynamically create and configure them.
http://www.donhopkins.com/drupal/node/40
http://www.donhopkins.com/lzxnet/my-apps/PieTest.lzx
http://www.donhopkins.com/lzxnet/my-apps/PieTest.lzx?lzt=source
http://www.donhopkins.com/lzxnet/my-apps/piemenu.lzx?lzt=source
The Laszlo pie menus dont currently support an API for modifying the
menus dynamically, but Ive been thinking about how that should work,
and how it could support user-editable menus that knew how to write
themselves back out as XML.
Some pie menus are dynamically generated from data, so all items are
usually handled the same (or from a small set of pre-defined handlers
based on the dataset), but other pie menus are designed by hand with
custom handlers, tracking feedback and graphical resources associated
with each item.
One problem with only defining widgets from XML, is how do you attach
custom methods and event handlers to widgets?
Including custom JavaScript handlers and constraints in the widget xml
definition would require a JavaScript compiler in the Flash player (but
it would be possible in the DHTML version of Laszlo). You have to
pre-define all the handlers and constraint expressions as named
functions, refer to their names in the xml, and look them up at
run-time.
-Don
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://openlaszlo.org/pipermail/laszlo-dev/attachments/20051128/021548e2/attachment.html
More information about the Laszlo-dev
mailing list