Content Management and Capture

Content Management and Capture

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

 View Only
  • 1.  To make the property readOnly using LayoutPropertiesPane.[Edited EntryTemplate]]

    Posted Wed October 07, 2020 04:08 PM

    I want to make the property readOnly with the help of aspect in JS(since I want to display a button beside the property dynamically that's why this approach)

    Tried the below code:

    lang.setObject("customOpenEntryTemplate", function(repository, items, callback, teamspace, resultSet, parameterMap) {

    console.log("inside customOpenET");

    if(items.length==1){

    var item = items[0];

    repository.retrieveItem(null, lang.hitch(this,function(item){

    this.entryTemp=item;

    var acid = new AddContentItemDialog();

    acid.showUsingTemplateItem(repository, null, true, false, callback, teamspace, this.entryTemp);

    aspect.after(acid.addContentItemPropertiesPane, "onCompleteRendering", function(){

    console.log("===Inside onLoad===");

    isonLoad=true;

    if(query(".defaultSpan").length == 0){

    var propJSON = acid.addContentItemPropertiesPane.getPropertiesJSON(true, true, true);

    console.log("onLoadPropJSON: "+JSON.stringify(propJSON));

    var commProps = acid.addContentItemPropertiesPane._commonProperties;

    var propsFieldEdited = commProps._view.properties;

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

    var name = prop.controller.id;

    console.log("name: "+name);

    if(name ==='strsAutoDeter' || name ==='DocumentTitle'){

    console.log("Inside: ");

    try {

    var node = prop.domNode;

    console.log("POC1: name="+name);

    prop.readOnly=true;

    Even I had tried-

    • this.set("readOnly", true)
    • this._view.set("readOnly", true);

    Any suggestion how we can achieve this?

    similar type of question asked in stackOverflow-

    https://stackoverflow.com/questions/47201583/make-properties-readonly-in-addcontentitempropertiespane

    but not getting the result.



    #IBMContentNavigator(ICN)
    #Support
    #SupportMigration


  • 2.  RE: To make the property readOnly using LayoutPropertiesPane.[Edited EntryTemplate]]

    Posted Fri October 09, 2020 03:00 AM

    Hi,

    It appears that readOnly is applied to specific properties 'strsAutoDeter' and 'DocumentTitle'. Have you customized the Entry Template layout? You may edit the Entry Template layout to make these properties readOnly.

    Regards,

    Angie



    #IBMContentNavigator(ICN)
    #Support
    #SupportMigration


  • 3.  RE: To make the property readOnly using LayoutPropertiesPane.[Edited EntryTemplate]]

    Posted Fri October 09, 2020 04:54 AM

    Hi Angie,

    we don't know which property we have to make readOnly (that is dynamic will come from XML) (Using this approach as-

    • can use openContentClass response filter but I have to display the button besides the property as well .
    • Tried custompropertyEditor as well but we have to explicitly add that customEditor for every property at ET level and the property is dynamic )

    Regards,

    Sonia



    #IBMContentNavigator(ICN)
    #Support
    #SupportMigration


  • 4.  RE: To make the property readOnly using LayoutPropertiesPane.[Edited EntryTemplate]]

    Posted Fri October 09, 2020 08:39 AM

    Hi Sonia,

    The property should be set readOnly before rendering the view. Overwriting ecm.widget._PropertiesPaneMixin.createRendering() function and setting attrDefs item to readOnly works for me.

    attrDefs[4].readOnly=true; this._applySourceItemAttributeValues(attrDefs, contentClass);

    Regards,

    Angie



    #IBMContentNavigator(ICN)
    #Support
    #SupportMigration


  • 5.  RE: To make the property readOnly using LayoutPropertiesPane.[Edited EntryTemplate]]

    Posted Fri October 09, 2020 11:45 AM


  • 6.  RE: To make the property readOnly using LayoutPropertiesPane.[Edited EntryTemplate]]

    Posted Fri October 09, 2020 01:06 PM

    Hi Angie, I am new to ICN. If you don't mind can you send the piece of code which u had tried.


    I tried-


    ecm.widget._PropertiesPaneMixin.extend({createRendering: function(contentClass, entryTemplate, item, reason, isReadOnly, showHidden, callback, onError) {.....


    I am not getting how to use and where to place the attrDefs[4].readOnly=true;


    this._applySourceItemAttributeValues(attrDefs, contentClass);



    #IBMContentNavigator(ICN)
    #Support
    #SupportMigration


  • 7.  RE: To make the property readOnly using LayoutPropertiesPane.[Edited EntryTemplate]]

    Posted Mon October 12, 2020 05:38 AM

    Hi Sonia,

    You may overwrite ICN JS by executing

    _PropertiesPaneMixin.prototype.createRendering=function(contentClass, entryTemplate, item, reason, isReadOnly, showHidden, callback, onError) { ... // customization code attrDefs[4].readOnly=true; // end of customization this._applySourceItemAttributeValues(attrDefs, contentClass); ... }

    in your plugin JS. Copy the code from ecm.widget._PropertiesPaneMixin.createRendering(), and place your customization code before the line of this._applySourceItemAttributeValues().

    Regards,

    Angie



    #IBMContentNavigator(ICN)
    #Support
    #SupportMigration