Preventing data change in portals

Under some situations I need to be able to prevent data change in a portal. I tried disabling the portal. This works but the data displayed in the portal is so dim I can hardly see it. I then tried to lock the individual fields in the portal but I could not access the individual fields in portals as elements. I also tried to start a transaction on begin edit of a form and then roll the transaction back if the data on the form was ‘locked’ ie) not intended to be altered. If I committed the transaction all went well. If I tried to rollback the transaction Servoy froze up.

John McCann

Windows, 2.0 beta 4, firebird 1.0

It is possible to make the fields non editible.

OK this solves part of my problem. OnShow I can switch the fields on the form to not editable if the record is ‘locked’.

However, I still have problems with portals. The fields in the portal cannot be adressed as individual elements and the portal element does not have the ‘editable’ property available as an option. So I still don’t know how to prevent the user from altering data in a portal except ‘disabling/greying’ the portal. Disabling/greying the portal dims the data to the point where I is not easily read it, so this won’t work. Any ideas?

Thanks

John McCann

Jan,

I checked it out. It doesn’t solve any of my problem because most of my fields are comboboxes and it looks like comboboxes do not have the ‘editable’ property. I noted that textfields do have this property, but they don’t work in my solution.

John McCann

It is in the plannign to make Portal elements accessible from javascript.
For now you can ofcourse not use a portal but a form in a table view (then you have much more power over everything)

Comboboxes do have a editble property (see property editor) but that one doesn’t have the same behaviour as a text fields because for a combo box it means that you can type directly into it or only choose from a list.

So you have to disable comboboxes and make textfields non editable.
(or from my head put 2 fields on top of each other with the same dataprovider, one combobox and one textfield (non editable) and show the textfield when the record is locked and the combo when it is not)