PDA

View Full Version : tutorial help/script buttons


jdanberg
04-28-2009, 08:57 AM
I'm pretty new to this, but I ran into something interesting.


<canvas height="150" width="100%">
<simplelayout/>
<!--Here is a button created with a tag -->
<button name="framitz" width="50">
hello
</button>
<script>
//And here is a button created with using script
var b = new lz.button();
b.setAttribute("width", 50);
b.setAttribute("height", 50);
</script>
</canvas>


That works fine, but when I do this:


<canvas height="150" width="100%">
<simplelayout/>
<script>
//And here is a button created with using script
var b = new lz.button();
b.setAttribute("width", 50);
b.setAttribute("height", 50);
</script>
</canvas>


It no longer works. ie, nothing shows up.
Including the button.lzx does fix that problem, but a coworker of mine does not need to do that, and his works regardless. I'm worried I didn't install something correctly. We are both using OpenLaszlo 4.3, but he is using the servlet in conjunction with jboss, while I am using the windows server, which I assume is the same, except for the fact that I'm using the packaged Tomcat server.

senshi
04-28-2009, 10:44 AM
Certain components are auto-included if they're referenced in lzx-code, see Chapter 15. Program Structure - 3.1.1. Auto-includes (http://www.openlaszlo.org/lps4.3/docs/developers/program-structure.html#program-structure.autoinclude) for a full description.