Unable to get what I want from a listbox

The app I’m porting to Xojo uses javascript and html for presenting to the user. The part I’m working on at present is an html table in the original app, which gives me access to some features missing from a listbox, which causes the following issues if I just use a listbox by itself:

  1. Can’t wrap text in a listbox row. In another part of the app, that’s just the behaviour I want, but just here wrapping is essential if the amount of text causes it, with that row (only) getting taller to accommodate the extra height.

  2. I need four rows with two columns, and then either no more rows or several more with nine columns.

To handle this I have an html viewer for the four rows, using an html table in it where the text will wrap if necessary and row height adjusts. Below that I will use a standard listbox because I need to have the cells be clickable.

However there are some disadvantages to doing it like this. One is that each of these controls will have its own scroll bar, another is that the html viewer and the listbox render colours slightly differently (with the same RGB value, I mean), which is not so good if it’s a background colour. Also it feels like a hack.

Is there a simpler way to do this?

Desktop or Web app?

[quote=244025:@Tim Streater]1) Can’t wrap text in a listbox row. In another part of the app, that’s just the behaviour I want, but just here wrapping is essential if the amount of text causes it, with that row (only) getting taller to accommodate the extra height.

  1. I need four rows with two columns, and then either no more rows or several more with nine columns.

[/quote]

A weblistbox IS a table.

Set the Weblistbox to multiline and it will wrap just fine.

I don’t understand your point two. Do you mean you need a table with two columns and four rows, and another with nine, or one with different number of columns along the rows ? The later is not possible.

It’s a desktop app, so, presumably, I can’t use a weblistbox. It’s not offered as a control in the library pane, at any rate.

As for point 2, ultimately I need a table that has four rows and two columns, but under some circs needs some extra rows. Those extra rows need more than two columns.

I see now that in my original app I’m using two html tables, but they are inside an html

which is allowed to have a scroll bar. As far as I could make out, a container-control can’t have a scroll bar, so I can’t usefully wrap the htmlviewer and listbox inside a container-control, thus each of the controls will have its own scroll-bar. Then there’s the colour issue but I suppose I could make the background be white in both cases.

Use the HTMLViewer to display your HTML tables into a web page. It will provide the scrollbars.

or search for Karen (?) Mergeable Listbox control… if I recall it is more than a listbox, but less than a spreadsheet, but should be able to do everything described here.

+1 for Karen’s Mergeable Cell Listbox