Manage this page

1. Display

2. Feedback

Docs

1. Developers guide

2. All docs

3. Reference

4. Samplecode

Additional links

1. Opensourced Laszlo

2. An earlier sample project definition using laszlo

Local helper

1. Laszlo explorer

Weblogs

1. David Temkin, CTO of laszlo

2. Oliver Steele, Architect at laszlo

3. Sarah Allen, Laszlo

Utilities/other sites

1. Blogblox

2. IBMs eclipse plugin

Installation instructions from the laszlo site

1. Seem to have its own tomcat

2. Seem to require jdk 1.4

It is not very clear from the installation docs (quickly) atleast how to configure it in a given tomcat instead of using its tomcat

Once you install it, do the following in the server.xml of your tomcat installation

(Context path="/lps-2.2.1" docBase="E:\satya\i\lps221\Server\lps-2.2.1" debug="0"/)

Overview of developing in laszlo


JAVA_OPTS='-Xmx512m -Xms256m'

1. Develop an lzx file in a text editor

2. Place it inside the webapp

3. Hit that url as follows


http://localhost:8181/lps-2.2.1/demos/satya/hello.lzx

Where the lzx file is like


(canvas)
   (text)helloworld(/text)
(/canvas)

1. You may have not set the java options to increase the memory. This will result in the compiler killing your java web server with an out of memory error.

2. It is also possible you have mistyped the java options for more memory. So check your spelling of the memory options. In my case I have missed the trailing "m"

Read the article

Sample code set1

The bottom part of the helper screen takes most of the real estate. How can I reduce it and expand the to portion of the screen.

on a public url on a public site I am getting connections refused through laszlo. Most likely it is a problem of the proxy. I need to use the proxy settings. Where can I do this?

Messages from the compiler are not the most detailed. So write your xml carefully and go over it a couple of times if you see a compiler error. A good xml editor will probably alleviate some of these. Otherwise check your spellings and so on and so forth.

My notes on working with tree controls

To push the debug stuff to the bottom set the canvas size to a higher value. Example

(canvas height="620")
(/canvas)

Language manual Read this for the language elements such as constraints ($), language variables, object syntaxt, over all philosophy etc.

What is the difference between a variable declared with and with out a var?

When a canvas is enabled for debug, a debug window shows up. How can you position this and size this so that it won't interfere with the rest.

When I open a modal dialog, it is allowing interaction with other dialogs on the screen. Also how come an alert dialog shows up only once?

They are allowed only inside of a canvas object

The script tags are executed immediately

Script tags can include code directly

Script tags can embed functions using the javascript syntax

You can have javscript style comments

You have to use CDATA if you were to have any less than or xml objectionable characters

Functions are global, similar to java script. Where as methods are scoped to classes and objects for which they are defined.

Example


(script)

//This is direct script
var name="satya";
Debug.write("hello " + name);

//This is a function
function sayHi(yourName)
{
   Debug.write("hello " + yourName);
}
(/script)

Classes or objects in lzx can have attributes. When an attribute is set, an event is fired for that attribute (onattribute). These events are called implicit events.

There are also behavioral events or called css events that look like "OnClick" etc.

There is a distinction between these two types.

For example the implicit events can not be caught by "onevent" attribute of a node. These can be only caught by a "method" version of catching an event.

Apparently the css events can be caught by both mechanisms

Although it is possible to set an attribute of a class using the setAttribute, you can also define a method to do that. It is similar to the "set" method for a member variable in java.

The setAttribute by default will set the variable and fire the onset event for that attribute.

your special method also need to do the same.

If you override the init() method, you need to call the supers init() first.

Example


super.init()

Read the 3.0 release notes

Bugs site

wiki

A discussion on jscript variables from the Microsoft site

As per the discussion, unless you declare a variable with "var" it will get a global scope.

In JScript, objects and arrays are handled almost identically ...

More on objects and associative arrays


// Object Literals

timObject = {
	property1 : "Hello",
	property2 : "MmmMMm",
	property3 : ["mmm", 2, 3, 6, "kkk"],
};

Where the timObject is all of the three at the same time

1. an object
2. an array
3. An associative array
4. A dictionary

Although there is no such thing as a "dictionary" an "object" and an "array" are full fledged objects in javascript and hence in laszlo

Read more about this

Highlights of the javascript programming language

In the object literal notation, an object description is a set of comma-separated name/value pairs inside curly braces. The names can be identifiers or strings followed by a colon. Because of an error in the language definition, reserved words cannot be used in the identifier form, but they can be used in the string form. The values can be literals or expressions of any type.

var myObject = {name: "Jack B. Nimble", 'goto': 'Jail', grade: 'A', level: 3};
return {
    event: event,
    op: event.type,
    to: event.srcElement,
    x: event.clientX + document.body.scrollLeft,
    y: event.clientY + document.body.scrollTop};

emptyObject = {};

New members can be added to any object at any time by assignment.

myObject.nickname = 'Jackie the Bee';
Arrays and functions are implemented as objects.

myList = ['oats', 'peas', 'beans', 'barley'];

emptyArray = [];

month_lengths = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];

slides = [
    {url: 'slide0001.html', title: 'Looking Ahead'},
    {url: 'slide0008.html', title: 'Forecast'},
    {url: 'slide0021.html', title: 'Summary'}
];

Douglas Crockford

Apparently the following will not work


function printDataSet(dataset)
{
	Debug.write(dataset);
}

That will print some object references. You have to do the following instead


function printDataSet(dataset)
{
	Debug.write(dataset.serialize());
}

How does serialization work in laszlo. What are the facilities, nuances, elaborations, etc.

Although you can print the xml using serialiation, it puts the entire xml on oneline. Wondering if there is a facility to pretty print this in laszlo!

Especially for dataset related classes.

How can you update a dataset pointed to by a datapath. What is the difference between a "addNodeFromPointer" and the "insertBefore" methods? One comes from the data node hierarchy and the other from the data pointer hierarchy. What gives?

Read a list of tips and articles on laszlo topics

Sample code and some explanation from Antun

Laszlo classes are instantiated using their tags in the xml document. How can you do this programmatically. Is there a general connection between the two?

Some how the reference does not list constructor methods for the classes. A departure from java or any other oop stuff.

1. Here is an example of programmatically instantiating data sets

2. Constructor arguments

3. Creating constructors with arguments

Like in java script are there any global functions such as alert etc.

Short of using the LzParam is there a clean way to use strings and escape functions to do this

when ask a dataset to refresh itself from a web server, it may tell you that it has a data conversion error. Initially you may think that there is some thing wrong with the url.

But the problem is laszlo is trying to parse what is coming back from the url. It expects this to be in xml format. It will be interesting to know if it is possible to receive non-xml data.. When it is not you get this data conversion error.

This is particularly pesky when you are retrieving html data segments. Because they may not be fully xml compliant. In that case it is necessary to put them in cdata sections.

There is no parameter you can set for scrolling on a view. You have to have scroll bar that is a child of a view to control its scrolling. It is an intricate dance that involves views, scroll bars, and height/width adjustments.

If I want to position a debug window I am able to do that by setting the x, and y values. But I am not able to name a debug window. I am also not able to place a debug window inside another view. How come?

The threads seem to suggest that it is not directly possible as flash does not have hooks into the native file system. The suggested approach is to use a browser.

What is not clear is, if we are coopting the browser then we are limited by the browsers ability to transfer files. For example how can you transfer 'n' number of files? Or how can you provide a drag and drop like functionality for files.

Some one suggested that laszlo has an ebay demo where they demonstrated a file upload. I need to go and check it what this is what capabilities it has.