Hi devs, 
trying to set up some program rules for an Event program in 2.20 (rev 19876) in 
a custom form, with mixed results. 

1)
Expression: {DropdownA} != 'Yes'        (also tried !{DropdownA} || 
{DropdownA}!='Yes' )
Action: Hide field {dropdown B}
I.e., unless dropdown A = 'Yes' dropdown b should be hidden/disabled. 

In data entry, dropdown B is never disabled. However, if I enter a value for 
both dropdowns, then change the value of dropdown A to something other than 
'Yes', I do get a warning that dropdown B will be cleared. So the rule 
expression seems to be right, but it is not disabling the field.


2) 
I have a four rows, each with a dropdown (diagnosis) and a checkbox. There can 
be diagnosis on 1-4 rows, but only one checkbox can be checked at any time. So 
I made a rule that says {checkbox A} => hide/disabled checkbox B-D, if checkbox 
B, disable A, C, D etc. 

In data entry, if I check box A, B-D is not disabled. If I check B while A is 
also checked, it will first tell me that B will be unchecked because A is 
checked, then that A will be unchecked because B is checked - with the result 
that both become unchecked!


Writing this up, I realise that in both case 1 and 2, the fields in question 
are also included in other rules. Could it be that only one program rule is 
applied to a field at any time? It would be a very big limitation if that is 
the case. Testing a bit further, it might even look like it is applying the 
rules somewhat randomly for fields that is mentioned in multiple rules.


As an additional point, I think it would be great to both have "hide" and 
"disable" actions, and that with the "disable" action you could chose whether 
to clear the values of disabled fields or not.


Regards
Olav
_______________________________________________
Mailing list: https://launchpad.net/~dhis2-devs
Post to     : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp

Reply via email to