PDA

View Full Version : Frustrating when examples from the documentation dont work


pcawdron
12-28-2006, 12:29 AM
Look, I'm sorry if this sounds silly, but it is really frustrating when the examples don't work. I'm sure someone's going to point out some obvious aspect that will solve all this, but please be aware that OpenLaszlo is a steep learning curve for some of us.

If the team at OpenLaszlo really want to make this a success, perhaps it would make sense to *expand* the references with more meaningful *working* examples. At the moment, the references could only be described as a cure for insomnia. Oh, and please, don't suggest that I do it. Yeah, right, lets get a neophyte to document how OL works, that would be really clever ;)

I'm currently trying to get the grid example working from http://www.openlaszlo.org/lps/docs/reference/index.html

I've set up an lzx file with... (copying straight out of the example)

<canvas height="250">
<dataset name="weatherdata" request="true" src="mydata.xml"/>
<grid datapath="weatherdata:/weather" contentdatapath="forecast/day"/>
</canvas>

I've set up mydata.xml with http://www.laszlosystems.com/cgi-pub/weather.cgi?zip=10022

But all I see is the headings, no data...

OpenLaszlo has soooooooooooo much potential, but without reducing the harsh learning curve it's never going to be taken seriously. Perhaps there are some out there that can spend days crawling slowly through the docs making sense of everything, but it really shouldn't be this difficult.

Sorry for being grumpy. I've just spent the last three days of my holidays really trying to give OL a good shot and it is unbelievably frustrating when even the simple things don't work.............................

jsundman
12-28-2006, 04:33 AM
It would seem that your application is not seeing the data. When you say that you have "set up" mydata.xml with the data from the cgi source, what do you mean? Did you populate that xml file? Have you verified that the data is there? And where is the file?

caclark
12-28-2006, 06:07 AM
Well, it appears to me that the example works fine, you've just done something wrong in acquiring the data.

I took your code and put the link to the laszlosystems.com CGI script directly into the dataset like so:


<canvas height="250">
<dataset name="weatherdata" request="true" src="http://www.laszlosystems.com/cgi-pub/weather.cgi?zip=10022"/>
<grid datapath="weatherdata:/weather" contentdatapath="forecast/day"/>
</canvas>


And the grid showed up fine...

Along the lines of what John was suggesting, make sure you can get the XML file to display by putting its name in the address bar instead of the .lzx file name, i.e.

instead of: http://localhost:8080/myapp/testGrid.lzx
try: http://localhost:8080/myapp/mydata.xml

benjamin
12-28-2006, 12:51 PM
Look, I'm sorry if this sounds silly, but it is really frustrating when the examples don't work. I'm sure someone's going to point out some obvious aspect that will solve all this, but please be aware that OpenLaszlo is a steep learning curve for some of us.

If the team at OpenLaszlo really want to make this a success, perhaps it would make sense to *expand* the references with more meaningful *working* examples. At the moment, the references could only be described as a cure for insomnia. Oh, and please, don't suggest that I do it. Yeah, right, lets get a neophyte to document how OL works, that would be really clever


I agree! The reference needs to be much better. Here's how we got here: the doctools had become an unmaintainable pit of doom that no one understood, and the docs decayed. One of the senior programmers on the team just spent most of november and december rebuilding the documentation tools. Now the reference is generated directly from the source, which paves the way for improvements to the content of the docs, and it's generated without python (yay!) so java developers can make sense of it.

And no, you're right, it wouldn't make sense for me to suggest that a newcomer write docs. Filing bugs on the docs, though, is a very concrete way to contribute to the docs quality. Could you please file the weather example bug into the bug database[1]? I know that when we say that, it sounds like we're saying "send complaints to /dev/null", but if you could see the workflow around here, we live and die by the bug database. Someone reviews and assigns new bugs almost every day.
http://www.openlaszlo.org/jira

One of the ways Laszlo Systems supports platform development is by offering OL training. There's a free online seminar coming up in two weeks, and the longer multi-day training sessions are a great way to get going with development. One of the course leaders is in fact the original author of the weather application.
http://www.laszlosystems.com/training

And *thank you* for spending your free time working with Open Laszlo. Please do keep posting questions here, or on the laszlo-dev mailing list.

-benjamin

pcawdron
12-28-2006, 03:47 PM
Thanks for being so understanding... it has stopped me from throwing in the towel...

In answer to the questions... "you've just done something wrong in acquiring the data."

* I don't think this is the case as the grid picks up the headers OK but there's no data, so its finding the file OK but not displaying it correctly.
* Yes, I can see both files in the same path just by changing the name
* mydata.xml is an exact copy of weather.cgi
* I get the same result regardless of whether I use the examples dataset or my own local dataset

<dataset name="weatherdata" request="true" src="mydata.xml"/>
<dataset name="weatherdata" request="true" src="http://www.laszlosystems.com/cgi-pub/weather.cgi?zip=10022"/>

With both datasets, I see the headings of each column coming up automatically but no data populating the grid.

Sorry, I haven't figured out how to attach a file but this link will take you to a screenshot ( http://cawdron.netfirms.com/gridproblem.JPG ) but all I can see is the grid header buttons (lable, imageurl, desc, temp) and one empty line in the grid (that highlights onmouseover). Clicking the header buttons causes the small sort triangle to show, but there's only ever one line in the grid, the empty line.

I've tried compiling to swf7, swf8, dhtml and then trying those combinations again with ie (instead of firefox). I though it might be something as simple as setting the height on the grid, but it still came up blank (only bigger).

Thanks for your interest and support.

Peter

david
12-29-2006, 10:44 AM
Peter, what version of OL are you using?

pcawdron
12-29-2006, 12:54 PM
I'm using legals, lps-4.0.pr4

Regards,
Peter

pcawdron
12-30-2006, 02:24 PM
Opps... try this instead to get to a screenshot

http://cawdron.netfirms.com/

PS. I'll leave this up for about 2 weeks only

benjamin
12-30-2006, 03:53 PM
Okay, I'm curious. Can you please post a zip of your code, or the code in its entirety here?

pcawdron
12-31-2006, 01:02 AM
Yeah, it's a puzzling one, isn't it. As you'll see, I'm not doing anything out of the ordinary. Also, for the record, I just tried both versions again and got the same result. I'm guessing no one else has run into this yet (?)

MyCanvasGrid.lzx
______________

<canvas height="250">
<dataset name="weatherdata" request="true" src="mydata.xml"/>
<grid datapath="weatherdata:/weather" contentdatapath="forecast/day"/>
</canvas>

MyCanvasGrid1.lzx
_______________

<canvas height="250">
<dataset name="weatherdata" request="true" src="http://www.laszlosystems.com/cgi-pub/weather.cgi?zip=10022"/>
<grid datapath="weatherdata:/weather" contentdatapath="forecast/day" height="200"/>
</canvas>

mydata.xml
_________

<weather sourceurl="http://www.srh.noaa.gov/zipcity.php?inputstring=10022">
<forecast>
<day label="TODAY" imageurl="http://www.srh.noaa.gov/ifps/text/images/hi_shwrs70.jpg" desc="Rain Likely" temp="Hi 60°F "/>
<day label="Tonight " imageurl="http://www.srh.noaa.gov/ifps/text/images/nwind.jpg" desc="Breezy " temp="Lo 34°F "/>
<day label="Wednesday " imageurl="http://www.srh.noaa.gov/ifps/text/images/wind.jpg" desc="Breezy " temp="Hi 46°F "/>
<day label="Wednesday Night" imageurl="http://www.srh.noaa.gov/ifps/text/images/nwind.jpg" desc="Breezy " temp="Lo 30°F "/>
<day label="Thursday " imageurl="http://www.srh.noaa.gov/ifps/text/images/few.jpg" desc="Mostly Sunny" temp="Hi 45°F "/>
<day label="Thursday Night" imageurl="http://www.srh.noaa.gov/ifps/text/images/nsn30.jpg" desc="Chance Snow" temp="Lo 32°F "/>
<day label="Friday " imageurl="http://www.srh.noaa.gov/ifps/text/images/sn40.jpg" desc="Chance Snow" temp="Hi 38°F "/>
<day label="Friday Night" imageurl="http://www.laszlosystems.com:80/weather/images/nsct.jpg" desc="Partly Cloudy" temp="Lo 26°F "/>
<day label="Saturday " imageurl="http://www.srh.noaa.gov/ifps/text/images/few.jpg" desc="Mostly Sunny" temp="Hi 40°F "/>
</forecast>
<current>
<windspeed>E 8 MPH</windspeed>
<when>Mar 14, 3:51 am EST</when>
<dewpoint>46°F (8°C)</dewpoint>
<station>New York, La Guardia Airport</station>
<barometer>29.42&quot; (996.4 mb)</barometer>
<where>New York, NY
</where>
<temp>49°F</temp>
<desc> Fog/Mist</desc>
<heatindex>None</heatindex>
<humidity>90 %</humidity>
</current>
<radar src="http://www.laszlosystems.com:80/weather/small/kdix.jpg"/>
<satellite src="http://www.laszlosystems.com:80/weather/thumbs/ECI8.JPG"/>
</weather>

pcawdron
12-31-2006, 07:23 PM
I downloaded the latest build (3199) and that works, but if I run 4.0 it doesn't work... so, looks like you've already solved a problem you did even know you had

Thanks,
Peter

benjamin
12-31-2006, 11:18 PM
That makes a bit of sense. The legals branch at 3199 is pretty far ahead of the 4.0b1 branch. It would be nice to capture your experience as a "fixed bug". first step is to file a bug and explain it clearly, www.openlaszlo.org/jira

pcawdron
01-01-2007, 02:00 AM
Benjamin,

I've added this to the bug database as fixed.

http://www.openlaszlo.org/jira/browse/LPP-3380

Cheers,
Peter