JS functions in form-field attributes aren’t executed as expected
search cancel

JS functions in form-field attributes aren’t executed as expected

book

Article ID: 213380

calendar_today

Updated On:

Products

CA Service Management - Service Desk Manager

Issue/Introduction

If the function $(ca_fd.js.DebugOn() == false); is used for the attribute “hidden“ of a Field Set, it won’t be executed.

If the attribute is set to ‘true’, the FieldSet is displayed.

The form-script uses the function DebugOn():

// -- Debugging der Funktionen und Felder --
       DebugOn : function()
       {
              return true;       },

Environment

Release : 17.3

Component : CA SERVICE CATALOG

Cause

A script function (method) is provided in place of expected expression which rightly throws an unexpected behavior

Resolution

This is a known behavior. The parameter expects an expression and it works without any issue if a expression is provided.
If you call a script function (method), it does not expect the same throws an unexpected behavior.

Having said that, validate the behavior with below workaround for confirmation

Form onLoad : ca_fd.js.init()

Similar Script===================
{
  isHidden:function(){
    return 'true';
  },
  init:function(){
    var isFieldsetHidden = ca_fd.js.isHidden()=='true'
    if(isFieldsetHidden)
      ca_fdHideField(ca_fd.formId,'fieldset_1');
  }
}

Additional Information

The issue defect has been addressed and will be available in 17.3RU9.
Please open a new case for any further queries in regards to the defect and solution ETA  if not already aware of the schedule time.

Attachments