2

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

ᄂ ᄀ
  • 5,669
  • 6
  • 43
  • 57
Archangle
  • 312
  • 1
  • 4
  • 23
  • take a look at below two methods. this might help afterRenderAttributes(attributeDefinitions, item, reason, isReadOnly) beforeRenderAttributes(attributeDefinitions, item, reason, isReadOnly) – bajji Nov 09 '17 at 17:16

2 Answers2

1

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 .

Archangle
  • 312
  • 1
  • 4
  • 23
  • @Amessihel , http://www.notonlyanecmplace.com/about-me/ , pick the idea in comments for making required fields false . – Archangle Apr 06 '18 at 17:33
0

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

WiredCoder
  • 916
  • 1
  • 11
  • 39