Field with lock icon displays briefly when hidden by UI policy

mark69
Giga Contributor

Hi,

If I add a field with a lock icon, for example a List type field, to a form and then create a UI policy that sets visible to false for this field then every time the form is refreshed the field is visible shortly. Then the field is hidden and the fields below it move up.

Is there any way that I can prevent this behavior?

 

9 REPLIES 9

Harsh Vardhan
Giga Patron

Create an ACL here, 

 

Operation : Read

Type: Record

Name Incident  field watch list

 

IF you want to run this acl on specific condition, then you can do that. 

 

Note: if you are going to use script here that problem will still occur. so go with an ACL. 

Good idea, I can try that. But the problem with this solution is that the field should be displayed when the value of another field changes and doing it this way would require a save action before the field will be displayed. 

 

yes that's a restriction here, acl works on server side. 

 

why are you running your ui policy on form load ? open your ui policy and unchecked the on load check box, after this ui policy will only run on field change. 

same way you can accomplish it using onChange client script. 

 

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
 if (isLoading || newValue === '') {
return;

}

g_form.setDisplay('watch_list',false);

}

 

The policy must run on form load because the field should be visible depending on the value of another field and this must also be checked on load. 

Disabling on load will just leave the field visible when it should not be.

 

i don't think then there is a way to fix it. on form load all the client script ( onload one ) and ui policy get invoked that does the work based on the order. if in case you will change the work , that will be visible for few mi seconds .