I have a form that starts disabled so that nothing gets edited accidentally. I use an EDIT Button to re-enable the elements on the form. This does not work in the Web Client - is this by design or have I missed a trick?
What exactly doesn’t work ? Can you edit the fields ?
lvostinar:
What exactly doesn’t work ? Can you edit the fields ?
On onLoad my app sets the form to controller.enabled = false;.
I have a button that (in SM) does controller.enabled = true;
The button does not enable the form in the WC?
Kahuna:
lvostinar:
What exactly doesn’t work ? Can you edit the fields ?On onLoad my app sets the form to controller.enabled = false;.
I have a button that (in SM) does controller.enabled = true;
The button does not enable the form in the WC?
Maybe the button is disabled ? Is the onAction executed ?
lvostinar:
Maybe the button is disabled ? Is the onAction executed ?
Its not disabled in the SC - so don’t know why it would be in the web client - not sure how to test that in the webclient? But using a debug-break and running WC from developer it appears that the button is not enabled?
MORE - I just tested setting the button to enabled using elements.but_edit_rec.enabled = true; after the controller.enabled = false; to no avail.
Kahuna:
lvostinar:
Maybe the button is disabled ? Is the onAction executed ?Its not disabled in the SC - so don’t know why it would be in the web client - not sure how to test that in the webclient? But using a debug-break and running WC from developer it appears that the button is not enabled?
MORE - I just tested setting the button to enabled using elements.but_edit_rec.enabled = true; after the controller.enabled = false; to no avail.
So, can you click on the button and onAction is not executed ? Maybe you can attach a small sample ?
Resurrecting an old post of mine here as I’m still having the same problem with WC not enabling elements on a disabled form??
Here is the story:
Form has
onShow()
application.output('Before Event - Test Button Enabled; ' +elements.butTest.enabled)
controller.enabled = false
elements.butTest.enabled = true
application.output('After Event - Test Button Enabled; ' +elements.butTest.enabled)
SC works as expected - everything disabled except the button. In WC the button is not enabled?
Guessing I screwed it up somehow, but here is a small solution to show what I mean.
onShow does an app output on the status of the button before and after the code (controller.enabled = false) and the Test button does an app outbut to show the it’s actually calling an onAction working (but is’nt in WC).
Appreciate feedback
Ian
TestSolutionSamples2.servoy (6.29 KB)
Any chance someone from Servoy could take a look at this please??
Appreciate it.
Ian
better is to make a case with that,
Also mixing controller.enabled and then field.enable is a bit weird.
In my view is if you use controller.enabled = false then the complete form just must be disabled until you set that to true again…
Because mixing this is just weird and confusing if you ask me
jcompagner:
better is to make a case with that,Also mixing controller.enabled and then field.enable is a bit weird.
In my view is if you use controller.enabled = false then the complete form just must be disabled until you set that to true again…
Because mixing this is just weird and confusing if you ask me
Johan - I’ll make a case for it but…
I need to have all fields on the form disabled but I need the labels (buttons) enabled to allow the user to move to the next record. If everything is disabled they they are stuck there. We have a form that hosts audit data and after the data has been closed-out the data is no longer editable, therefore we wont allow access to it. But the user needs to be able to go to the next record which may not yet be closed out.
We have worked around it by setting all fields on the form non-editable - but lot more code work for the form, than simply setting controller enabled and then re-enabling what you want!
Is’nt that what controller.readOnly = true for??
that disables editing, but doesn’t touch labels & buttons.
Harjo:
Is’nt that what controller.readOnly = true for??that disables editing, but doesn’t touch labels & buttons.
In web client it seems to disable the button too Harjo
so readonly = true disabled buttons in the web?
that sounds like a bug to me, create a case.