Not editable displayType Calendar fields issue

Hi.

I have editable property not checked in a field with displayType “CALENDAR”. The expected behaviour (at least for me) is that you can not edit the field (even clicking the button to select the date). But the current behaviour is that you can click the button and select a date (it change the data) and you can manually delete the date but not insert it.

I think it isn´t right, isn´t it?

Thanks
Victor.

This is the expected behavior: If you don’t want the button, make the display type of your field a “textfield” instead of a Calendar field

Paul

pbakker:
If you don’t want the button, make the display type of your field a “textfield” instead of a Calendar field
Paul

as far as I can see, it’s not easy possible to change the display type (easy like disable/enable),
because i need to do it with solution model and recreateUI()

Now my workarround is, to stop the action inside onDataChange with a message and then set the new value back to the old value.
This is not very nice and I agree with victor.rojo.

pbakker:
This is the expected behavior

What for expected ? A field can be changed without respecting disabled/enabled ?
regards

I don’t really get the issue:
You have a field of type Calendar, that has an editable property: the editable property determines if the user can edit the field just through the popup behind the button, or also by directly typing into the field.

Controlling if the the user can change the value in the field can be controlled using the enabled property.

Paul

Thank you Paul. Maybe something else I do wrong.

I simply set the field to editable. The field itself is not editable, but the button shows the calender and there the date can be changed.

The following printscreen shows a debugger-stop in the onDataChange (what meens that a date could be changed) and at the same time
you can see that the editable is false (right arrow).
[attachment=1]Print_Screen_01007.jpg[/attachment]
[attachment=0]Print_Screen_01008.jpg[/attachment]

I use the actual Servoy 6.0.0, but it happened also in RC.
regards

So that is exactly what I described: the editable property determines if the user can type directly into the field or not. It does NOT restrict using the button. For that you need to use the enabled property.

Paul

pbakker:
So that is exactly what I described: the editable property determines if the user can type directly into the field or not. It does NOT restrict using the button. For that you need to use the enabled property.
Paul

Thanks paul, I understand.

We allow the user to copy ALL fields-value as default, even if they are not in Edit-mode. So we use enabled=true and editable=false as default.
The problem:
The enabled property not only lets the field look “grayed”, but prevents the user from the possibility to making a copy of the fields value (for later paste somewhere).

After a while playing arround with the properties I found a workarround:
readOnly:
http://wiki.servoy.com/display/public/D … d-readOnly

Why is is this not visible in the form-editor-props ? Is there any strong reason to NOT use it ?
regards

If somebody want’s to here …

the property “forms[‘xxx’].elements.xxxx.readOnly = true” works fine for

  • prevents the user to using the calender-button (if not in edit-mode)
  • let the user make copy paste of the value a date-field
  • greyed out just the button, but not the field itself (very nice)

but careful:
if you use a find() search(), after this operation all settings of readOnly
are gone. So I save it (true/false) before I go into find() search() and restore
it after.

stefanoni:
if you use a find() search(), after this operation all settings of readOnly
are gone. So I save it (true/false) before I go into find() search() and restore
it after.

It should automatically restore the last readOnly value. Did you try this in Servoy 5.2 and also is not working there ?

I work with Version 6.1. of Servoy and have no Installation of 5.xxx to try
regards