B4J Question tableview selectedrow question

boten

Active Member
Licensed User
Longtime User
ok, I can select a row in a tableview & scroll to it,
but it is not highlighted with the same hues (lightblue) as per clicking a row.
How to make the selected row stand up in the crowd in blue (and not in grey)
 

boten

Active Member
Licensed User
Longtime User
When a row is selected via
B4X:
tv1.ScrollTo(j)
tv1.SelectedRow=j
the selected row has grey background

adding :

B4X:
tv1.requestfocus
paints it blue, like a clicked row

my question: what css need i supply so that a selected row BUT NOT focused will have another color, not grey

tried using:
B4X:
.table-row-cell:filled:selected {
  -fx-background-color: pink;
}

but that just replaced the blue with pink regardless if the tableview was clicked or just row-selected (without request focus)
 
Upvote 0

boten

Active Member
Licensed User
Longtime User
The solution described in the link you provided changes the background for selected row REGARDLESS if the tableview is focused or not.

the CSS below will have 2 color for selected rows: 1st for selected AND focused; 2nd for selected BUT NOT focused.

B4X:
.table-row-cell:selected {
   -fx-selection-bar: #0093ff;         ' <---------------- the "default" blueish hue for selected & focused 
   -fx-selection-bar-non-focused: #C0FFC0;    '<---------- color for selected BUT NOT focused line
}
 
Upvote 0
Top