controller.readOnly

Hi , I would like an enhancement/change of the controller.readOnly function.

Because we use our own security system, we check on some forms, if the user is allowed to change/edit data yes or no.

so we make a method attached to onShow
if(blabla) controller.readOnly = true
else controller.readOnly = false

But the problem is that the forms in the tabpanels become readOnly too. This is the default behaviour now. But, what I would like is, that if I do make a method to the onShow of a tabpanel:
controller.readOnly = false

that that form(tabpanel) is allowed to change/edit data again.

I know that I can do this by naming every element en setting every element by hand. But this would simplify a lot!

Is that possible?

If you set the readonly for each form of your tabpanel you should be able to handle readonly as you want. For example:

controller.readOnly = true // controller form
forms.detail_a.controller.readOnly = true // form A in tabpanel
forms.detail_b.controller.readOnly = true // form B in tabpanel
if you then execute a method that:

forms.detail_b.controller.readOnly = false
then the form A in the tabpanel should be writable while the controlling forma and the form B in the tabpanel should stay readonly.

Version 2.1

Hope this helps.

bye

Yes, I know, but now the opposit.

I want the main-form: readonly = false
and the tabpanel: readonly = true

That is not possible, because the main-form is disabling the tabpanels too!

Sorry Harjo but it works fine with me:

controller.readOnly = false
forms.detail_b.controller.readOnly = true
forms.detail_a.controller.readOnly = true

please note that I put in readonly the forms that are in the tabpanel, not the controlling form.

bye

That’s what I ment by main-form → the controlling form.

If I set this one to controller.readonly = true, than also all the tabpanels are readonly.

if I set a tabpanel to: controller.readonly = false, they are not enabled again!

I want to use it, for the following.
My customers has users, who are not allowed to change/edit anything to the customer section,
but they can make notes or todo’s for the customer.

But that seems exactly my same problem, and I solved it with:

controller.readOnly = true
forms.notes.readOnly = false
forms.todo.readOnly = false
or
controller.readOnly = true
forms.notes.readOnly = true
forms.todo.readOnly = true
depending on the user’s privilege.

Probably I miss something of your problem…

:oops: :oops: sorry, it works now.
I tried it before, but it did’nt work.

Must have done something wrong.

Thanks again!

Is it also possible to set a portal row on readonly?