Content Management and Capture

Content Management and Capture

Come for answers. Stay for best practices. All we’re missing is you.

 View Only
Expand all | Collapse all

Not able to make the Entry template property as read only

  • 1.  Not able to make the Entry template property as read only

    Posted Wed October 27, 2021 12:25 PM

    In Entry template, on select the file we are setting the ET property values. Here we need to make ET property read only after setting the value to the property. We are using aspect.after(AddContentItemDialog, "_onFileInputChange", function(){.....}. How we can achieve this?



    #IBMContentNavigator(ICN)
    #Support
    #SupportMigration


  • 2.  RE: Not able to make the Entry template property as read only

    Posted Wed November 03, 2021 01:13 PM

    Hello -

    We reviewed this request and the condition and resulting issue are not quite clear.

    Can you offer some deeper detail?

    Current code and intended functionality -> current result -> expected result.



    #IBMContentNavigator(ICN)
    #Support
    #SupportMigration


  • 3.  RE: Not able to make the Entry template property as read only

    Posted Wed November 03, 2021 02:43 PM

    Hello,

    Basically, we want to make the property to readOnly on selection of file/document(e.g. on click of Browse button for Add/CheckIn).I suppose it can't be done using filter. So, we tried using aspect.

    Code-Snippet:

    aspect.after(AddContentItemDialog, "_onFileInputChange", function(){

    var commProps =this.addContentItemPropertiesPane._commonProperties;

    var props = commonProps._view.properties;

    array.forEach(props, function(prop, i){

    var name =prop.controller.id;

    if(name === "test"){

    var node = prop.domNode;

    dojo.style(node, "readOnly", true);

    });

    }

    Is there any way, we can make the Property to readOnly on selection/Browse of the file??



    #IBMContentNavigator(ICN)
    #Support
    #SupportMigration


  • 4.  RE: Not able to make the Entry template property as read only

    Posted Wed November 03, 2021 04:39 PM

    What is the backend repository where the content is stored? Why is it that you need to make the document read-only at that particular point in the content ingestion process?

    Can you offer screenshots with added context and clarification, possibly?



    #IBMContentNavigator(ICN)
    #Support
    #SupportMigration


  • 5.  RE: Not able to make the Entry template property as read only

    Posted Wed November 03, 2021 06:06 PM

    You can try to use this code:

    var commProps =this.addContentItemPropertiesPane._commonProperties; var field = commProps.getFieldWithName("test"); if (field) { field.set("disabled", true); field.set("readOnly", true); }



    #IBMContentNavigator(ICN)
    #Support
    #SupportMigration


  • 6.  RE: Not able to make the Entry template property as read only

    Posted Thu November 04, 2021 06:28 AM

    Hello,

    We tried with the above code snippet getting the field value as null and it is throwing the error.

    Please find the below code snippets for reference.

    var commPropss =this.addContentItemPropertiesPane._commonProperties;

    var field_1 = commPropss.getFieldWithName("DocumentTitle");//it is giving the null value

    console.log("field_1:"+field_1);//null

    field_1.set("disabled", true);// Here it is throwing the error in the console.

    field_1.set("readOnly", true);



    #IBMContentNavigator(ICN)
    #Support
    #SupportMigration


  • 7.  RE: Not able to make the Entry template property as read only

    Posted Thu November 04, 2021 06:35 AM

    And also we tried with below code also. But not able to make the property read only.


    var propertiesPane = this.addContentItemPropertiesPane;

    var acip = this.addContentItemPropertiesPane;

    var commProps = acip._commonProperties;

    var fields = commProps._view.properties;

    fields[0].set("disabled", true);//not getting any error here

    fields[0].set("readOnly", true);



    #IBMContentNavigator(ICN)
    #Support
    #SupportMigration


  • 8.  RE: Not able to make the Entry template property as read only

    Posted Thu November 04, 2021 01:12 PM

    What is the error? Please provide as much detail as possible.



    #IBMContentNavigator(ICN)
    #Support
    #SupportMigration


  • 9.  RE: Not able to make the Entry template property as read only

    Posted Wed November 10, 2021 05:06 AM

    Hi, We are getting the below error.


    field_1:null

    VM700:85 Uncaught TypeError: Cannot read property 'set' of null

      at Object.eval (eval at _initializePlugins (ecm.js.jgz:123554), <anonymous>:85:16)

      at Object.requestCompleteCallback (dojo.js.jgz:22442)

      at Object._onFinished (ecm.js.jgz:50765)

      at Object.<anonymous> (ecm.js.jgz:50524)

      at XMLHttpRequest.<anonymous> (dojo.js.jgz:22442)

    eval :85

    (anonymous) :22442

    _onFinished :50765

    (anonymous) :50524

    (anonymous) :22442

    XMLHttpRequest.send (async)

    send :50539

    Request.postFormToPluginService :52042

    eval :336

    dispatcher :37733

    (anonymous) :22438

    dispatcher :37730

    (anonymous) :22438



    #IBMContentNavigator(ICN)
    #Support
    #SupportMigration