crodster2k (2) [Avatar] Offline

I will be buying the ebook + softbound package shortly. Unfortunately the most important chapter for me isn't available yet. Chapter 17 working with large datasets.

I am building an application right now that uses large datasets and has a lot of fields with datapath bindings. The tabelements populate extremely slowly and I am fairly sure this is because of the huge number of xpath expressions that must be executed for each new tabelement that is replicated. In short, what is the best way to "speed up" the application?

I suspect the answer is to programmatically access the lzDataElement from with the ondata handler of the tabelement. What is the best way to do that?

One solution that I've got working in prototype is to add an oninit method within the text elements that push a variable into the lzDataElement's variables. So the init looks like:

parent.parent.parent.parent[this.getAttribute("name")] = this;

This works.. but it's kind of ugly because the text fields are heavily nested. Then in the lzDataElement's ondata handler I can do:


Is this the best way to deal with large datasets? Sure I could clean the code up some by defining custom classes etc.. but is the basically the correct way to do things? If not, some pointers in the right direction, or an extremely early draft of chapter 17 would be very helpful.

nklein (33) [Avatar] Offline
Re: Working with large datasets
It really isn't possible to directly answer this question based on this small code sample. It appears that the problem isn't the complexity of each datapath but with their overall number. The key to improving performance is to cut down the number of working views and their associated datapaths by using lazy replication or paged datasets (or both together).

We are working as hard as we can to incorporate many of the features that were released at the last minute with the official release of Laszlo 4.0 into the chapters of the book. Additionally, although 4.0 has just been released there is still important details that are still being documented and made available, such as the <switch> tag for supporting Flash and DHTML code segments.

I know that many readers are impatient with the release of our chapters, but we really are moving at the fastest pace possible right now.

Anyway thanks for your continued patience.