What can I embed within a WebListBox?

I put some text in a web list box with carriage return \ line feeds .
The text came out formatted as i expected.

I was wondering what else I could do to enhance the contents within a WebListBox?
Can I embed pictures or html or javascript?

CellPicture
You can add a lot more if you dig into the structure of the weblistbox and how cells are defined.
You need some knowledge of javascript to change cell contents but, basically, a lot can be done.

As you can see, you can also embed images in a weblistbox and in its header
Image

Take a look here

This a sample project

[quote=374229:@Maurizio Rossi]CellPicture
You can add a lot more if you dig into the structure of the weblistbox and how cells are defined.
You need some knowledge of javascript to change cell contents but, basically, a lot can be done.[/quote]

I have no idea why but i appear not to have CellPicture in my WebListBox.

Type "WebListBox" has no member named "CellPicture"

[code]ListBox1.AddRow(lvs, attr.GEtoString, sps+attr.getDescription, attr.getVR, attr.getVM, attr.getDataSize.ToText, “Pixel Data”, “”)

Dim p As Picture
p = RenderImage(img)
Dim wp As WebPicture = p

ListBox1.CellPicture(0,0) = wp[/code]

What Xojo version are you using?

2016 R2.1 Pro

I don’t remember exactly when CellPicture was added so you can find a solution here:
Pictures in weblistbox cells

It looks like it was added in 2016r4

http://developer.xojo.com/2016r4-release-notes

I told you not to tell me, 99.

Awesome font also.

So am I out of luck? Do I have to buy a new Pro License?

Test this

ListBox1.AddRow "<raw><b>Test</b></raw>"

If you can see bold “Test” then you don’t need to buy a new license.

You don’t need to buy a new license, you can embed stuff using javascript just like Xojo does.

As stated by Xojo staff, if you need something not available in the web framework you can doit using javascript and WebSDK.
As an example one thing that you can’t use at its full potential is CSS i.e. styles: this is something that also the latest Xojo version simply lack.

The problem is if you want to invest in knowledge or pay someone else for plugins.
It’s not so difficult to master javascript for some things like adding an image to a cell as already reported in the above forum link.
Knowledge in HTML, CSS and javascript is something that can be reused a lot if you need to develop web apps.

[quote=374489:@Asis Patisahusiwa]Test this

ListBox1.AddRow "<raw><b>Test</b></raw>"

If you can see bold “Test” then you don’t need to buy a new license.[/quote]
No I see the text exactly as is. :frowning:

Thanks all.

Can WebListBox’s embed WebControls?

The Raw tag helps with basic things, you can hook up the events you embed with a custom WebControlWrapper control if you need. I’ve also used JQuery to embed container controls inside of listboxes in the past as well.

Just requested:

54683 - Add WebListBox.CellContainer Method for easy Lists of WebContainers
<https://xojo.com/issue/54683>

WebListBox has the ability to place Text, HTML, and Pictures into WebListBox Cells.

While Scrolling WebContainers make it possible to create a list of WebContainers, it adds complexity in order to manage positioning WebContainers when adding or removing WebContainers. Adding a WebContainer to a Scrolling WebContainer requires finding the top of the lowest item, adding its height, and adding a margin. Removing a WebContainer from a Scrolling WebContainer requires removing the WebContainer, then finding each WebContainer lower than the WebContainer and moving it up based on the height of the removed WebContainer plus the margin.

If WebListBox could hold WebContainers, it would make managing as list of WebContainers a pleasure.

Workarounds:
Scrolling WebContainers with Embedded WebContainers

Hey Brock,

I’m going to test this soon, but I was wondering if the following idea might work based on your amazing experience…

  • Create a WebListbox
  • Add a Listbox Row with something like this in the Cell
<raw><div id='myListboxRowUUID'></div></raw>
  • Instantiate a WebContainer in the Listbox RowTag
  • Embed the WebContainer somewhere on the page
  • Move the WebContainer from the page to the WebListbox Cell with something like this
jQuery("#webContainerUUID").detach().appendTo('#myListboxRowUUID')

Do you think that would work?