How does one disable the row selection in the table view in smart client? I need to show a list of names, but not allow any record selection by the user. This is in Servoy 6.0.4.
The easiest option is to define the row colors in your style sheet like this:
odd {
background-color: #F5F7F9;
}
even {
background-color: #FFFFFF;
}
selected {
background-color: #d4d4d4;
color: #FFFFFF;
}
If you want more control, you can use the onRender event, see this page for more info.
Thank you for this suggestion, however, the question is not about showing to the user which rows are selected, but rather foundset changing the selected rows set internally. I do not want to the form’s foundset to select the records (foundset.getSelectedRecords) when the user clicks on the table when it is in the disabled or read-only state. The problem is that currently in the smart client the foundset is still updated, even when all textfields’ enabled property is set to false. The web client appears to have the correct behavior, but I need this in the smart client. Is this a bug? Is there any workaround for this?
When the textfields are disabled, the user can’t enter data, but he should still be able to change the selection. This should work the same in smartclient and webclient.
To get the behaviour you want, you can disable the entire form, by doing:
forms.yourForm.controller.enabled = false;
Thank you. This works. It would be nice not to disable controls in the form’s header and footer though, i.e. disable only the table view. Currently, the workaround would be to move all such controls into an outer form.