WebListBox 0 column width doesn't hide data web 2.0

If the column width is set to 0 it does not hide the data in column.

I think it was reported before but can’t find the Feedback case.

Is there any update on this? In 2020r2.1 weblistbox does not hid columns even if columnwidth is set to 0 or 1 (tried 1 because 0 didn’t work). Tried shown event, opening event, setting in inspector, no avail. How can I hide a column i don’t want shown?

Don’t put the data in the listbox if you don’t want it shown. On web, making it zero width would still mean the data was sent to the browser and that someone could “see” it by looking at the page source.

2 Likes

it’s not confidential,but I just dont want that column to be displayed. It works in previous versions, so why not in 2020? thanks

1 Like

Can you put the data into the RowTag instead?

1 Like

I have some columns with data that must be included in the weblistbox and must be hide (not visible).
In previous xojo versions, solution is to set the columnwidth to 0.
Which is the way in the latest xojo version to hide a column of the weblistbox ?

No can do. Arbitrary column widths are not working in WebListBox 2.0, unless there is a JavaScript workaround.

Could probably come up with something but, with the way that the WebListBox re-renders, any action taken on it could overwrite the change. I’ll take a look.

Yeah, there’s just too much to workaround here, including explicit column widths. There is, however, an option for hidden columns in the underlying library to support this.

Decided to dig into the API. Place this method in a module:

Public Sub ColumnVisible(Extends lb as WebListBox, index as Integer, Assigns value as Boolean)
  Session.ExecuteJavaScript( "$('#" + lb.ControlID + "_table').DataTable().column(" + index.ToString( "#" ) + ").visible(" + value.ToString.Lowercase + ");" )
End Sub

Call as:

Listbox1.ColumnVisible(1) = False
6 Likes

in the desktop listbox, I usually store hidden datas in columns after the columncount of the listbox.
they are still available, and they are not displayed
don’t know if this works in weblistbox.

edit: it does not work in 2021r11: xojo tests the columncount and throw an outofbound !
edit2: yes seems best way is to store what you need in the rowtag

Anthony - You are my hero! Works perfectly! Thank you!

3 Likes

@Anthony_G_Cyphers your solution is not working for me using Xojo 2022 r1.1
Anyone had tested this extended method in this Xojo version ?

Sorry… in the shown event handler works fine… not in the opening event handler

2 Likes