WebListBox with cellstyle not updating when row is selected

Just recently moved a project from 2015r4.1 to 2016r1.1, and something seems to have changed with WebListBox cell styles in regards to the selected row.

If a cell has a custom webstyle set, it will not properly update the text color & background color when the row is selected. Sometimes it will do one but not the other.

Making a custom style with a blue background and white text and then assigning that to the listbox’s SelectionStyle seems to work. Is this the new proper way to handle this?

This has probably been reported or talked about but I can’t find it with the search…

[quote=272334:@Tom Iwaniec]Just recently moved a project from 2015r4.1 to 2016r1.1, and something seems to have changed with WebListBox cell styles in regards to the selected row.

If a cell has a custom webstyle set, it will not properly update the text color & background color when the row is selected. Sometimes it will do one but not the other.

Making a custom style with a blue background and white text and then assigning that to the listbox’s SelectionStyle seems to work. Is this the new proper way to handle this?

This has probably been reported or talked about but I can’t find it with the search…[/quote]
File a bug report today if you can, and make sure there’s a sample project. We made a change to how WebStyles render in 2016r1 which allows them to override framework styles more easily, but I thought we had caught all of the side effects.

This has caused a ton of issues for me as well.
The change broke the styling to a ton of my custom controls. I think the biggest pain is because Xojo uses the “!important” tag on CSS styles now like the background, which makes overwriting using things like JQUERY not supported. I had to rewrite a ton of code to get things working and in general using the “!important” tag is poor practice. WebStyles are now even more of a disaster than they were before. If there was an easy way to toggle the important flag on/off it would help - never had a problem with it not existing before the change…

@Tom Iwaniec
As a workaround you can modify this method to get a specific table cell. Change the “html” method to “css” and make sure Jquery is included.

Sub cellHTML(extends lb as WebListBox, row as integer, column as integer, assigns html as string) html = html.ReplaceAll("\","\\\").ReplaceAll("'","\\'") lb.ExecuteJavaScript("$('#" +lb.ControlID + "_userrows tr').eq(" + str(Row) + ").find('td').eq(" + str(Column) + ").html('" + html + "');") End Sub

Thanks, I’ve reported it here: <https://xojo.com/issue/44260>

Also ran into a bug where you can’t set a SelectionStyle at runtime, which was previously reported here: <https://xojo.com/issue/36928>

Have any bug reports been filed?

hm. now that I’ve seen this in action, I’m not sure I consider this a bug. But I’ll discuss it with the team.

Thanks Greg. Yeah I wasn’t sure either. Only thing that makes it seem “buggy” is that you have to fake a default behavior (blue background with white text) with a custom WebStyle to get the cells to act “normally” when selected. Plus it was an obvious change from 2015r4.1 > 2016r.1.1.

I’m fine with the current workaround as long as I know that’s what I’m supposed to be doing.

My feeling is that if you’re going to apply custom cell colors, that you should also expect to need to set the selection style, but we haven’t discussed it yet.

That said, this was a fix for a long time issue with WEBStyles in that now user styles can override more of the framework styles. It is this change that altered this behavior because now your custom style is applied over the selection style as well.

Well it’s not technically a bug so much as a pain in the rear to work around, so no - nothing has been filed. I’m still not even sure of the full scope of the issue. I know that the “!important” tags have been overriding manually applied styles/customizations through extension methods and custom controls but I’m not sure what the fix would be. Currently I just have to apply my own “!important” tag as well to override Xojo’s important tag - it just sucks that Jquery doesn’t support this out of the box so to speak.