1165 views

Description

g_form.showFieldMsg scrollForm does not work in CMS.

Steps to Reproduce

The [scrollForm] behavior documented in the 'g_form.showFieldMessage' method does not work in CMS; scrolling to the message only works in non_CMS.

  1. Log in to a Fuji instance.
    Note that glide.ui.scroll_to_message_field is true in the base system.
  2. Navigate to Service Catalog > Categories > Maintain Items.
  3. Select any active catalog item (for example, Apple iPhone 5).
  4. Add a new yes/no checkbox (test1) variable with the lowest order value so it displays at the top.
  5. Add a new Multi Line Text (comments1) variable with the highest order value so it displays at the bottom.
  6. Add the Catalog Client Scripts -> Catalog Item related list to the catalog item form by using Configure > Related List.
    • Name: setFocus
    • Applies to: A Catalog Item
    • Active: true
    • UI Type: Desktop
    • Application: Global
    • Type: onChange
    • Catalog Item: Apple iPhone 5
    • Variable name: test1
    • Applies on a Catalog Item view: true
    • Script:

      function onChange(control, oldValue, newValue, isLoading) {
      if (isLoading || newValue == '') {
      return;
      }
        g_form.showFieldMsg("comments1", "You need to populate Comments","info",true);
      }

  7. From the Catalog Item record, click the Try It button.
  8. Change yes/no checkbox (test1) variable from Yes to No.
  9. Focus and auto-scroll to message and field specified (comments1).
  10. Launch CMS and repeat steps.
    The message is displayed, but focus and auto-scroll does not occur.

Workaround

There are two options.

The first option is to display the message right underneath field (test1 in above scenario) by modifying script:

from:  

g_form.showFieldMsg("comments1", "You need to populate Comments","info",true);

to:

g_form.showFieldMsg("test1", "You need to populate Comments below","info",true);

-or-

The second option is to force the focus to the field at the bottom of the form by modifying the script to:

g_form.showFieldMsg("comments1", "You need to populate Comments","info",false);
location.href="#";
location.href="#" + g_form.getControl('comments1').id;


Related Problem: PRB648044

Seen In

Fuji Patch 7 Hot Fix 5

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2017-10-25 11:54:57
Published:2017-10-25