Content Management and Capture

 View Only
  • 1.  Content Navigator Search Template - Formatting the field

    Posted Fri February 03, 2023 10:24 AM
    Hi,

    I have a Content Navigator Search Template. There are 4 search criteria fields. Please find the attachment. Out of 4, 2(RPT NAME and FILE_NAME) are mandatory fields. We have a requirement that search must be possible if any of the mandatory field has value.

    I did customization using plugin to achieve this. This is working. Currently I am showing asterisk beside the field label to indicate that this is Mandatory field. But this is merely noticeable.  My requirement is, I would like to show red colour asterisk for these 2 fields. Please let me know if you have any idea how to achieve this requirement.



    Regards,
    Ravi

    ------------------------------
    RAVI KUMAR
    ------------------------------


  • 2.  RE: Content Navigator Search Template - Formatting the field

    Posted Mon February 13, 2023 03:12 AM

    Hi,

    Please suggest me some solution.



    ------------------------------
    RAVI KUMAR
    ------------------------------



  • 3.  RE: Content Navigator Search Template - Formatting the field

    Posted Mon March 13, 2023 01:41 PM

    Hi,

    Could any one please look into this.



    ------------------------------
    RAVI KUMAR
    ------------------------------



  • 4.  RE: Content Navigator Search Template - Formatting the field

    Posted Wed March 15, 2023 03:58 AM

    Hi Ravi,

    add this piece of code in your plugin

    Code

    require(["dojo/aspect","ecm/widget/search/SearchForm","dojo/_base/array","dojo/dom-construct","dojo/_base/lang"], function(aspect,SearchForm,array,domConstruct,lang) {
          aspect.after(SearchForm.prototype, "_renderCriteria", function() {
              if(this.searchFormInputArea) {
                  var labels =  this.searchFormInputArea.getElementsByTagName('label');
                  array.forEach(labels, lang.hitch(this,function(label) {
                      if(label && label.innerHTML.indexOf("ID") >= 0) { // change to RPT_NAME || FILE_NAME 
                          domConstruct.create("span", {"class":"required", innerHTML:"*"}, label);
                      }
                  }));
              }
         });
      });

    sample output 

    Best Regards,

    Shashi Kumar.L



    ------------------------------
    shashi kumar
    ------------------------------