I have a composite component that extends a datefield to add “today” and “clear” buttons. These buttons should be disabled when the field is not editable or when it is not enabled. When I call setEditable or setEnabled from a screen controller, the field behaves as expected. However, the buttons do not seem to honor attribute permissions. If I set a date attribute as read-only as part of a role and use my custom component as the component in a form, the value field honors those permissions but I can’t figure out how to get the buttons to also honor them.
Attached are the definitions and controller for the composite component.
Add state change listener to the ValueSource. The state will be active if an item is set to the container, and we can update the availability of buttons. However, it doesn’t work if an item won’t be loaded or we set ValueSource that already has an item to the component.