As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
Hi. I'm trying to create a form with required fields and with a help marker.
If you create a project using the Alfresco SDK 3.0.0 archetype you will get a sample content model and Share form configuration. One of the sample types is acme:document which is configured with a mandatory aspect called acme:securityClassified. That aspect has a property called acme:securityClassification.
The acme:securityClassification property is not defined in the content model to be required. If it were, the required indicator would show up in Share automatically.
However, let's say we want the field to show up as required, even though the model doesn't say it is required, and we want to add some help text.
If you edit src/main/resources/META-INF/share-config-custom.xml you'll find a section that defines the Share form for acme:document by searching for "<config evaluator="node-type" condition="acme:document">".
To make securityClassification required and have some help text, change the field definition from:
<field id="acme:securityClassification" label-id="form.field.label.acme.securityClassification" set="acmeDocSet" />
to:
<field id="acme:securityClassification" label-id="form.field.label.acme.securityClassification" set="acmeDocSet" mandatory="true" help="Select one of the security classification choices from the list." />
If you would rather provide an I18N key to your help so that you can translate it into multiple languages, use help-id instead of help.