javascriptdojoibm-content-navigatoribm-case-manager

Make Properties readonly in addContentItemPropertiesPane


I am looking for a modified add document view using AddContentItemDialog .

i manage to set parent folder , Intro Text , title and documents properties with script adapter in Work Details

    try {
         var parentFolder = self.case.getCaseFolder();
         self.addContentItemDialog = new AddContentItemDialog();

         self.addContentItemDialog.setDefaultContentClass(prefix+"_Dumy01");


         aspect.after(self.addContentItemDialog.addContentItemPropertiesPane, "onCompleteRendering", function() {

             console.log("aspect.after(self.addContentItemDialog");

              self.addContentItemDialog.addContentItemPropertiesPane.setPropertyValue("Test_1", "123");
              self.addContentItemDialog.addContentItemPropertiesPane.setPropertyValue("DocumentTitle", "YYYYYY");

              self.addContentItemDialog.set("title","This is New Add Doc Event");
              self.addContentItemDialog.setIntroText("New Msg Can Be Set In this Tab");
         }, true);
         console.log("XX");
         self.addContentItemDialog.show(parentFolder.repository,parentFolder,true,false, null, null, false, null);
}catch (exception) {                                   
     console.log("exception" + exception);
}

Now I am looking to make few Properties readonly after setting them up from script.

maybe like ,

self.addContentItemDialog.addContentItemPropertiesPane(Property).set("readOnly", "true");

Thanks


Solution

  • the fix for this was , to call this under "onCompleteRendering"

            var fields = this._commonProperties._propertyEditors._fields;
    
            for (var i = 0; i < fields.length; i++) {
    
              if(_logic_){  //Like (fields[i].get('name') == (prefix+"_MainFileCategory"));
                fields[i].readOnly = true;
                fields[i].textbox.readOnly = true;
              }
            }
    

    found idea from http://www.notonlyanecmplace.com .