Make Properties readonly in addContentItemPropertiesPane

877 Views Asked by At

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

2

There are 2 best solutions below

1
Archangle On BEST ANSWER

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 .

0
WiredCoder On

If I got your question correctly, I am led to believe that your best option in that case would be EDS, it would be easier and more flexible. please check the link below from ECM community blog, giving a simple example that you can leverage to achieve similar results

Sample External Data Service for IBM Case Manager by Dave Hanson

Also, Please check the ICM 5.2 Redbook, which referenced Chapter 16 of the previous edition of the ICM Redbook (the ICM 5.1 edition): Download

Finally, This link from developerWorks is a straight forward white paper with sample code that I found very useful back when I started using EDS for case manager: Download