How to conditionally require a field to have data entered based on document life cycle state?

I want to require a field to be filled in the edit mode but only if and when a specific life cycle state is the current state.

If I check the required button the field is required even if it is not displayed in edit mode. I already have conditional statement DISPLAYING the fields in edit mode based on life cycle state by using (#{layoutValue.currentLifeCycleState=='XState' ? 'edit':'hidden'}).

I would like to implement the following logic: Require and display an arbitrary field if the document is in life cycle state X.

Can this be done with studio?

Do I need a custom widget/layout?

Validation?

1 votes

1 answers

2747 views

ANSWER



Making a widget required based on the same criterion is easy: the property named “required” can accept an EL expression as value, such as “#{layoutValue.currentLifeCycleState=='XState'}.

Just fill a “custom property” with name “required” and it'll override the value held by the checkbox.

1 votes