I add values to a WebListbox, which are created by WebListBoxCellRenderr to show them in Bold or right aligned, for example. With version 2021r1, I was able to read the contents with CallValueAt . And this was a json, so I was able to read the value.
With 2021r2 this doesn’t work any more. As soon as I try to read the value, I get an exception (TypeMismatch). So I don’t know how to read the values now. I need them for later processing.
To store the unformatted value in a CellTag is no real solution, because I use this today for other values. And there are not enough columns free. And I have to change most parts of my applications again.
Does some know a way to get the values from the list.?
Which version are you using?, it seems to be working fine using Xojo 2022r1.1.
If you’re using a WebListBoxStyleRenderer, for example, you can get its value using this code:
Var row As Integer = 0
Var column As Integer = 0
Var myCellRenderer As WebListBoxStyleRenderer = ListBox2.CellTextAt(row, column)
MessageBox(myCellRenderer.Value)
Type mismatch error. Expected class WebListBoxStyleRenderer, but got String
dim myCellRenderer As WebListBoxStyleRenderer = me.CellTextAt(me.SelectedRowIndex, 0)
When you populate a WebListBox with .AddRow("cell1", "cell2")
Or you add text to a cell .CellTextAt(x,y) = "the text"
Everything is fine
But if you want to put some colors, or just add bold text in your cell using style and renderer thing, you can’t retreive any text from the cell, you need to do a funny extraction like Ricardo shows :
dim myCellRenderer As WebListBoxStyleRenderer = me.CellRendererAt(me.SelectedRowIndex, 0)
Xojo boasts that it’s easy to program in this language. I waste hours trying to find a solution for a simple function in the documentation that doesn’t even mention this phenomenon.