cancel
Showing results for 
Search instead for 
Did you mean: 

Changing required fields on add content

elu
Champ in-the-making
Champ in-the-making
Does anybody know of a way to modify which fields are required on the "Modify Content Properties" screen of the add content dialog? I thought that I could simply modify jsp/content/add-content-dialog.jsp; however, that particular screen isn't dealt with there. I want to make the description and author properties of the final screen required fields just like the name field, but I can find no way to do so. Perhaps there is also some way to do this through configuration … I'm just not sure.
2 REPLIES 2

rama_honge
Champ in-the-making
Champ in-the-making
The configuration file is   "repository/config/alfresco/model/contentModel.xml". Add the mandatory tag <mandatory enforced="true">true</mandatory> for the fields that are to be made mandatory.

Better approach is to add the configuration as custom content model. Refer http://wiki.alfresco.com/wiki/Step-By-Step:_Creating_A_Custom_Model
or Alfresco Developer guide for more details.

savic_prvoslav
Champ on-the-rise
Champ on-the-rise
well easyest way is to add java script to do so.
function checkButtonState(){if (document.getElementById("dialog:dialog-body:name").value.length == 0 ){document.getElementById("dialog:finish-button").disabled = true;}else{document.getElementById("dialog:finish-button").disabled = false;}}function validate(){if (finishButtonPressed){finishButtonPressed = false;return validateName(document.getElementById("dialog:dialog-body:name"),decodeURI('</f:verbatim><a:outputText value="#{msg.validation_invalid_character}" encodeForJavaScript="true" /><f:verbatim>'),true);}else{return true;}}‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍
you get the idea.