Is it possible in VFE to have options “grayed out” when a certain item is selected?
Example: When a checkbox is checked is it possible to have the other 2 boxes below it to be “grayed out” so they can’t select them at all? Could you also do the same things with the Action buttons as well? We are wanting to reduce the possibility of errors with clinical staff. I do have a screenshot example if needed for further reference.
I would put those things that you want "grayed out" in visibility regions and only make them available when the correct response is answered.
The current check boxes and action buttons are already in visibility regions.
On the Advanced tab of most fields, there is an Enable/Disable Expression dialog. If you check the box "Use enable expression", the field becomes active. You can then write an expression that when it evaluates to True, the field is enabled. You would write your expression for the two lower check boxes to look at the top check box value and expect it to be empty. When your top check box is checked, the other two boxes will be disabled (grayed out). You can click the Help button when you are on the Advanced Tab in a field in VFE for more info.
You can layer visibility segments to accomplish want you want to do. It is not possible to set text colors in code. Action buttons, however, can be disabled. Click on tab Advanced of the ActionButton definition, bottom section labeled Enable/Disable Expression.
There are two design considerations to using visibility layers:
User perception - sometimes users mistake hidden fields for 'blank space'. While typically an aesthetic issue, it can hinder the development of muscle memory for routinely used items or items that bear enough importance that user familiarity with their existence is important.
Performance - using a visibility layer creates additional MEL used to hide or show elements on the form. The more items within the layer, the larger the MEL statement(s). These can substantially increase overhead both in physical code foot print and watcher code execution. Additionally, some form elements, such as list boxes utilizing dynamic lists, do not refresh properly when residing in visibility layers due to a refresh defect in the EMR that has existed for quite some time. Additional code to compensate for this defect is often required resulting in larger code foot print and execution overhead.
If the desire is to do as requested and the space is not needed in a different layer, I would recommend the enable/disable approach based on the information mentioned above for a more efficient and stable solution.
This seems like the best solution for my question. Can you give me an example of an expression that I should use? It would be greatly appreciated.
Say that your check box is "Patient is an emancipated minor" and your other two boxes are edit fields are Parent or Guardian 1 and Parent or Guardian 2. Your check box is a document variable called EMANCIPATED. Your edit fields would have an enable expression of DOCUMENT.EMANCIPATED == "". Once the check box was checked, that statement would no longer be true and the two edit fields would be disabled.
Thank you! Your help is very much appreciated!
I have run into one issue... Can I not use 2 variables in the same enable expression area? Example :
DOCUMENT.G8483 == ""
DOCUMENT.G8484 == ""
It seems to be disabling everything when I try this?
It would need to be DOCUMENT.G8483 == AND ""DOCUMENT.G8484 == "". Your enable/disable needs to be one expression.
would it not be this:
DOCUMENT.G8483 == "" AND DOCUMENT.G8484 == "" ?
Yes, sorry, my copy and paste messed up 🙂