PDA

View Full Version : Datacombobox freezing


mrhattyhat
01-21-2008, 02:35 AM
I know much has been said and written (and lamented) about comboboxes and datacomboboxes, and I've gone through all that (well, most of it). So here's my issue:

A basic application, two datacomboboxes: one for states (all states and territories in the US, total of 59), the other for cities which gets populated by a dataset that is called when the state is chosen. The result is a list of cities in the chosen state. Needless to say, in some cases this is a pretty large list.

For states like Delaware it works ok, but for large states like California, the cities list actually does load moderately fast, but here's where it sticks. Once the list is loaded and I make a choice, the entire app freezes. I can't click any buttons after that, I can't change tabs (the lists are inside a tabpane), I just have to wait for the dreaded "run slowly" warning to pop up.

Questions:

1- Why does the app choke AFTER the list is already loaded?

2- Is there a better component I should be using for this kind of thing, or alternatively, is there some way to tune the datacombobox for better performance (i.e. some way to force the app to release resources that it used building the list or something)?

frethog
01-24-2008, 01:08 PM
I have yet to use this in my application, but it sounds like lazy replication management could optimize the initial query and possibly improve post query performance.

Set the datapath’s replication attribute to lazy <datapath name="abc" replication="lazy"/>

Search "replication" or "lazy" in these forums.

Or try:

http://www.openlaszlo.org/lps3/docs/reference/datapath.html

http://www.openlaszlo.org/lps3/docs/reference/lzlazyreplicationmanager.html

Best regards,

frethog

mrhattyhat
01-24-2008, 02:01 PM
Thanks Frethog, but I don't think datacombobox supports a datapath element in the same way that a normal combobox does. That is, I tried this approach already, and while it didn't give me any errors, it also didn't load the data properly. I got a blank combobox.

My declaration looks like this:

<datacombobox x="150" y="57" defaulttext="Choose One..." name="cmbCities" width="220" shownitems="10" itemdatapath="dsCities:/results/city"/>


I'm still at a loss as to why it would freeze the app, however, after the data is already loaded. I can understand it freezing while it tries to load the list if the dataset is particularly large, but once it's loaded, I would expect that the app would perform ok. As it is, it behaves as though there's a memory leak, with performance degrading with each step in the procedure (state list loads, choose a state, city list loads, choose a city, click something else, all progressively slower until full freeze).

I'll toy around with the lazy replication and see if it helps, if I can make it work, although I think I read somewhere that datacombobox uses lazy replication by default.

frethog
01-25-2008, 06:37 AM
Looks like what you describe matches this open bug:

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

Admittedly, I'm not using datacomboboxes in my apps. I have a feeling you chose them on purpose for a specific benefit.

In my application, I don't have my data-driven lists dependent on each like the more sophisticated app that you are building. So, in my primary OL application, for data-driven lists, I use one instance of <list> <textlistitem/> </list> and six instances of <combobox> <textlistitem/> </combobox>.