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.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.