WebListBox too basic

Why is WebListBox so limiting? I love Xojo - very easy to use so far - but some key ingredients seem to be missing - like a column for checkboxes instead of showing a “Y or N”

Well, there is a 10 year difference in desktop and web.
I personally wrote a couple of feature requests for the web edition including listbox improvements.
Maybe you also write your wishes and your comments to existing cases?

Learn how to use WebContainers and you’ll rarely use a WebListbox again. WebContainer lists get automatic scrollbars and scroll handling. Each row of the list is another WebContainer.

We’re about done with a very large web edition accounting project. Very complex ‘list boxes’ that contain checkboxes, popup menus, (and much more) and are nothing but WebContainer lists.

And where would one get more info on these WebContainer Lists…Please.

John

Start with the example projects for WebContainer and learn the EmbedWithin method. You will have a web container ‘list’ and a web container ‘row’. You add the rows to the list and I tend to use a similar API to the WebListbox (i.e. AddRow, DeleteAllRows, RowCount, InsertRow, RemoveRow, etc) so it’s familiar. Inside the list you keep track of the ‘rows’ with an array and dynamically resize the list as rows are added/removed.

For subscribers I have a training video on how to do this at http://www.bkeeney.com/XojoTraining/xojotraining.cgi

Demo app running at http://www.bkeeney.com/apps/WebContainer/webcontainer.cgi. The formatting is fugly (too much playing around with styles) but the list is a graphic and a label to simulate a tri-state checkbox.

Thanks Bob - its a step in a direction… not sure which one at this point.
I am successfully using the WebContainer for “tabs” basically… but did not think about using them for the individual rows of a dataset.

I am a huge fan of WebContainers and Containers (Desktop). I think they’re one of the most underrated things in Xojo. Very powerful once you figure them out.

now to figure out how to put this all together…
A Container of parts inside a Container (List) on a Container (TabView)… Argh!
My eyes are rolling to the back of my head.

If I double click on something in a container, how can the main form respond? Or make the container do something on the main form?
ie:
WebPage with 2 Containers
ContainerA - on the page as ContainerA1
ContainerB - on the page as ContaimerB1

Double Clicking an item in the ContainerA1 makes ContainerB1 show up.

Hi

Tried to have a look at your training videos but never seems to load the video list.?

John

There’s currently a bug that got exposed by using Segmented Controls in R4. Click on one of the segments again and it should load. Also, you can look at everything available by using the Toolbar at the top and selecting Free or Subscription Videos.

[quote=56528:@Craig Reilly]now to figure out how to put this all together…
A Container of parts inside a Container (List) on a Container (TabView)… Argh!
My eyes are rolling to the back of my head.[/quote]

One step at a time. Once you get the hang of it it’s not so bad. Starting with small test/example projects is a good way to master a topic.

+100

It’s always best to step away from your main project when you start with something new. Keep it very simple. I make a lot of “throwaway” projects to test various aspects of stuff out.

Where do you think I get most of my training projects? I figure it’s always best to kill two birds with one stone if I can.

Hi Bob
Hoping to pick your brain about something I thought you said about EMBEDWITHIN and the web.

Just dredging up this old thread as I want to create my own weblistbox with web containers.
Im a bit vague but I thought I read where you said
“Stay away from embed within on the web for container controls”
Is that the case. i.e. kills performance?

And would a custom container LIST with a set number of placed LIST LINE containers. i.e. 20 be a better option?
i.e. List LINE custom containers, that populate and become visible as they are needed , and invisible when they are not?

Hope Im clear
Regards James

EmbedWithin is very slow. So if you have a ‘listbox’ with 20 rows you only want to create enough controls to fill it. You do not want to destroy and create them on the fly as it would be awful slow.

Then you’ll have to come up with the algorithm to push data between the visible rows and the invisible rows as you scroll.

Brilliant Bob Thanks

[quote=222014:@Bob Keeney]EmbedWithin is very slow. So if you have a ‘listbox’ with 20 rows you only want to create enough controls to fill it. You do not want to destroy and create them on the fly as it would be awful slow.

Then you’ll have to come up with the algorithm to push data between the visible rows and the invisible rows as you scroll.[/quote]
I have implemented a container based web list, each row has 1 checkbox and 1 textfield. When I originally did this a year or more ago (perhaps with some differences) I didn’t like the performance and so suffered with built in weblistbox. A few months ago I tried again as described here (checkbox + textfield per row). I generate the initial needed rows on the fly, but when the list is refreshed, I hide the rows not needed rather than closing them. This way I do not need to re-create all the rows every time, I just make them visible when needed. And when I need more, I just create the additional rows I need. I have been very pleased with the performance of this app and so have not had to go back to the built in weblistbox - just as Bob says.

Of, forgot to mention - my lists are sometimes 100-200 rows long (more than 20 for sure). And sometimes many hundreds of rows.

That’s awesome. I’d love to see how you are managing row scrolling and row management.

Pretty easy. I have a container called ListRow, I have a container called ListContainer, then I have a page or another super container that holds an instance of ListContainer. Scroll bars come naturally as the list grows. I keep some variables around - like RowCount, and I have an array, Rows() which is an array of ListRow instances in the Listcontainer. I can compare RowCount (the number of rows in the database record I am displaying) to Rows.Ubound to see if I need new rows or if I should hide rows. Not much tougher than that. Not sure if your question was more specific than that.

The ListRow container also has several variables to track things like ROWID and other parameters that I want the user to have quick access to just by interacting with the row. What I really like about this design is that the UI is completely Row based (as opposed to list based). Generally speaking, I have no need to track things like ListIndex (the position of the row in the list). Once I create the row in its place, it scrolls with the rest of them. When the user interacts with a row, I have the ROWID and everything else I need to do what is need with the data. I have also implemented things like InsertRow, where I can just move everything the distance of RowHeight and create a new Row where I want it.

I have also extended this to a Hierarchical List that I use for Folder oriented use cases. Several months of working well so far.