@AlbertoD @Jose_Fernandez_del_Valle
Here is a visual summary capturing some (but not all) of the issues you maybe experiencing. It might assist your feedback case.
Kind regards, Andrew
@AlbertoD @Jose_Fernandez_del_Valle
Here is a visual summary capturing some (but not all) of the issues you maybe experiencing. It might assist your feedback case.
Kind regards, Andrew
While this controls shouldn’t appear, the listbox always uses RowSets behind the scenes because we create an in-memory sqlite database to manage the data.
Thank you for clarifying that point @Greg_O_Lone. At what point, should those controls appear (greater than 25 rows if adding rows with AddRow)?
They shouldn’t appear at all in the config we are using because they cause issues with positioning and we aren’t using pagination.
Thanks, Andrew.
That is what happens to me, I fixed it by adding the code where it works.
In your example, ColumnWidths is always ignored. On my end, one ColumnWidth works and the other does not.
Thanks to you, I am a step closer to migrating from XOJO 2019 to XOJO 2020.
I’m running Xojo 2020R2, and the following code in Opening or Shown of a WebListBox does not change the column widths:
Me.ColumnCount = 5
Me.ColumnWidths = “100, 200, 50, 100, *”
If I run the code in the Shown event, I get the “Show X entries” and “Previous / Next” buttons as shown in Andrew’s post.
Is there a workaround as I need to set the number of columns and their widths dynamically?
Try this code:
In WebListBox SHOWN event:
Me.ColumnWidths = “100, 200, 50, 100, 20”
In WebListBox OPENING event:
Me.ColumnSortTypeAt(0) = WebListBox.SortTypes.Unsortable
Me.HeaderAt(0) = “Any Name”
…
Tell me if it worked for you.
In my experience, only dynamic change works on a SHOWN event.
No, that didn’t work.
Did you actually got this to work so you could set the column widths?
Not really. Try to add only one character (at least less than your column is defining), then it will work, but if you are adding then more text it might very well overrule your settings. In other words: it works for me for columns with a fixed number of characters (dates etc), but if I can’t predict the length of the content, I usually run into trouble. Can you confirm this by trying it yourself?
Here is my summary of issues with the WebListBox 2.0:
Plus, the text within WebListBox cells do not wrap — the WebListBox shrinks until the text fits on one line, then will shrink no more.
Thank you David, even though it’s i bit depressing.
Issue 1, 2 and 3 in your list prevent me from upgrading my apps to web 2.0.
With your list I know which issues I should wait for.
You can make a cell wrap by using a WebListBoxStyleRenderer.
Gary, can you elaborate?
I cannot see anything in WebStyles (https://documentation.xojo.com/api/user_interface/web/webstyle.html) to do with Cell Wrapping, nor in the CSS guide (Animatable CSS properties - CSS: Cascading Style Sheets | MDN), nor in the Xojo LR.
Don’t worry Gary, I worked it out from here Web2 : enable multiline word-wrapping. Thank you.
I also include this line. style.value(“word-wrap”) = “break-word”
I don’t remember why, but it fixed some issue that I was having with the wrapping.
Thanks
I’ll try that too, thank you!
You might want to try skipping the padding line as well, or playing around with it in a deeper granularity. Padding alone will change the padding of all 4 directions (top, bottom, left, right ). You probably don’t want to change the “padding-left” to 0 or 1 everywhere.
This article might help you as well:
You can add this to the list: Unable to set weblistbox.columnwidths in code (https://xojo.com/issue/62938)
Wow, you are right!
I just assumed it was working at 100%. I have added an updated Sample project to #2 (<https://xojo.com/issue/61610>) with a new Random button, where the column widths are adjusted randomly to widths <= 100%, and there there is zero effect on the displayed column widths.