readOnly settings

Hi,

I create a form in record view and set the form to readonly in the onShow event
Now the fields are readonly, but I can still select/copy the field contents.

If i set this form to tableview or listview (using the same onShow method), I can not select/copy the field contents.

Is this normal behavior ???

if I change the line ```
controller.readOnly=true;


to

for ( var i=0 ; i < elements.length ; i++){
	elements[i].readOnly=true;
}

all the (named) fields are readonly and I can select/copy the text in all fields in Recordview, Listview and Tableview.

Why does this work (in Listview and Tableview)when looping trough the elements and not when settig the complete form to readonly.

Regards,

Hans

Hello Hans

It’s quite difficult to comment about what is normal behaviour, as opinions seem to be far apart, at least sometimes from my point of view .-)
But I think it would be absolut necessary to have control about being able to select/copy (and paste) a fields content when it’s read only. Sometimes that’s needed, sometimes one wants to avoid that functionality.
Another thing is to decide wether to (consistently) use .readOnly or .enabled for a field, which do not have the same behaviour, beside the applied grey colour. I found mixing the two functions leads to an even more inconsistent HI behaviour and users get more or less lost.
I also would love to have a consistent behaviour on this, also in conjunction with the search mode.
There is also the design property editable to take into consideration for the behaviour of the above mentioned .readOnly or .enabled functions.
I think one could declare one of the two as deprecated and refine the other one or make the 2 clearly differentiated, and then the Servoy doku should say what’s the differentiation and examples when to use which one.
The problem with these subject is that it seems small but made at least for us a lot of trouble and I still don’t have a satisfying solution. As I said, we work with .enable, and enable/disable the appropriate fields in onLoad, … and make the field editable (design property).

Regards, Robert

if you set readonly on the controller then you make the controller readonly (controller being record/table/listview)
problem is that record view readonly is the same thing as making all elements readonly, because thats the only way to do it

list/table are different they have a separate edit flag (the controller itself must first go into edit then a field can go into ‘edit’ (you can access it that it is again in readonly is an other thing))
and if you set a list/table in readonly that first step is just not allowed so you can never access the fields component to select/copy from it.