2. An earlier sample project definition using laszlo
1. David Temkin, CTO of laszlo
2. Oliver Steele, Architect at laszlo
Satya - Wednesday, April 20, 2005 10:42:42 AM
Installation instructions
Installation instructions from the laszlo site
1. Seem to have its own tomcat
2. Seem to require jdk 1.4
Satya - Wednesday, April 20, 2005 10:43:38 AM
How can it co-exist with an existing tomcat?
It is not very clear from the installation docs (quickly) atleast how to configure it in a given tomcat instead of using its tomcat
Satya - Wednesday, April 20, 2005 11:37:22 AM
Configuring on an existing 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"/)
Satya - Wednesday, April 20, 2005 12:52:51 PM
Overview of developing in Laszlo
Satya - Wednesday, April 20, 2005 12:55:45 PM
Recommended java settings
JAVA_OPTS='-Xmx512m -Xms256m'
Satya - Wednesday, April 20, 2005 1:46:33 PM
How to deploy an application
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)
Satya - Wednesday, April 20, 2005 1:48:12 PM
What can go wrong?
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"
Satya - Wednesday, April 20, 2005 3:27:54 PM
An introductory article by William Grosso on java.net
Satya - Wednesday, April 20, 2005 7:42:40 PM
Here is a taste of laszlo: Sample code set 1
Satya - Thursday, April 21, 2005 2:36:07 PM
How to adjust the framesize when viewing lzx
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.
Satya - Thursday, April 21, 2005 2:45:13 PM
Why am I getting a connection refused on an http url?
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?
Satya - Thursday, April 21, 2005 3:09:44 PM
Compile messages won't be granular enough
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.
Satya - Friday, April 22, 2005 10:06:41 AM
Working with tree controls
Satya - Friday, April 22, 2005 10:49:12 AM
How to adjust the framesize when viewing lzx
To push the debug stuff to the bottom set the canvas size to a higher value. Example
(canvas height="620") (/canvas)
Satya - Friday, April 22, 2005 2:23:54 PM
The lzx language manual
Language manual Read this for the language elements such as constraints ($), language variables, object syntaxt, over all philosophy etc.
Satya - Saturday, April 23, 2005 10:19:37 AM
What is the difference between a variable declared with and with out a var?
What is the difference between a variable declared with and with out a var?
Satya - Saturday, April 23, 2005 10:20:33 AM
How to position a debug window?
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.
Satya - Saturday, April 23, 2005 10:21:57 AM
How come a modal dialong is not really modal?
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?
Satya - Saturday, April 23, 2005 1:23:44 PM
About script tags
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)
Satya - Saturday, April 23, 2005 1:35:27 PM
Implicit events
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
Satya - Saturday, April 23, 2005 1:46:05 PM
What are setters
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.
Satya - Saturday, April 23, 2005 1:47:14 PM
Overriding the init method
If you override the init() method, you need to call the supers init() first.
Example
super.init()
Satya - Friday, April 29, 2005 2:29:48 PM
An unlikely place to understand laszlo's language elements
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.
Satya - Friday, April 29, 2005 2:36:00 PM
An interesting note on objects and arrays
In JScript, objects and arrays are handled almost identically ...
Satya - Friday, April 29, 2005 2:40:50 PM
More on objects and associative arrays
Satya - Friday, April 29, 2005 2:46:58 PM
Apparently you can do this in javascript
// 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
Satya - Friday, April 29, 2005 3:03:47 PM
IT might be a good time to get a refresher on javascript
Satya - Friday, April 29, 2005 3:06:07 PM
Here is a brief quote from the above ref
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.
Satya - Friday, April 29, 2005 3:06:54 PM
Another note on array or dictionary initialization
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'}
];
Satya - Friday, April 29, 2005 3:10:27 PM
An interesting detour to the author of the above fine Javascript manual
Satya - Friday, April 29, 2005 5:00:24 PM
How can I serialize a dataset?
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());
}
Satya - Friday, April 29, 2005 5:01:23 PM
What is then, the concept of serialization in laszlo?
How does serialization work in laszlo. What are the facilities, nuances, elaborations, etc.
Satya - Friday, April 29, 2005 5:45:47 PM
How to pretty print xml using Laszlo?
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!
Satya - Monday, May 02, 2005 1:50:57 PM
Is there a class diagram for the laszlo classes
Especially for dataset related classes.
Satya - Monday, May 02, 2005 1:53:11 PM
How can you update a dataset pointed to by a datapath
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?
Satya - Tuesday, May 03, 2005 12:20:12 PM
More documentation: Tips from the experts
Satya - Tuesday, May 03, 2005 12:42:51 PM
Copying data sets
Satya - Tuesday, May 03, 2005 4:13:45 PM
How to instantiate laszlo classes?
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?
Satya - Tuesday, May 03, 2005 4:52:11 PM
How come there is no constructor documentation in the reference
Some how the reference does not list constructor methods for the classes. A departure from java or any other oop stuff.
Satya - Tuesday, May 03, 2005 5:01:19 PM
More on constructors
1. Here is an example of programmatically instantiating data sets
Satya - Wednesday, May 04, 2005 7:09:12 PM
Are there any global functions?
Like in java script are there any global functions such as alert etc.
Satya - Wednesday, May 04, 2005 7:16:23 PM
How to escape url params?
Short of using the LzParam is there a clean way to use strings and escape functions to do this
Satya - Thursday, May 05, 2005 5:35:06 PM
What is data conversion error
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.
Satya - Thursday, May 05, 2005 5:38:52 PM
Getting a tree, or a view or a window to scroll is tricky
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.
Satya - Wednesday, May 18, 2005 6:13:13 PM
How come I can't name a debug window
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?
Satya - Saturday, July 02, 2005 3:05:00 PM
Is it possible to do file upload using laszlo
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.
Satya - Saturday, July 02, 2005 3:05:56 PM
Check the ebay demo for file uploads
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.