16 views

Description

When adding an onchange attribute to a reference macro (using the g:ui_reference), the onchange listener is not triggered when the value of the reference macro is set via an ATF step Set Component Values (Custom UI) or via the Page Inspector.

Steps to Reproduce

1. Create a sys_ui_page with the following content:
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:ui_reference name="usrrequestor" query="active=true" id="usrrequestor" table="sys_user" value="" onchange="console.log('### OnChange Fired');"/>
</j:jelly>

2. Open the ui page and open the ATF Page Crawler
3. Select the element and set its value to any value
4. Look at the console

Behavior: Console logs do not contain "### OnChange Fired"
Expected: Console logs should contain that log statement

Workaround

A change event is fired from a different, not-instrumented, element of the reference macro's expansion. This change event bubbles and can be caught via an element which holds the reference macro (such as a div). When manually setting the reference macro's value, this event is fired when clicking away from the reference macro after setting its value.


Related Problem: PRB1442253

Seen In

There is no data to report.

Intended Fix Version

Paris Patch 5
Quebec

Safe Harbor Statement

This "Intended Fix Version" information is meant to outline ServiceNow's general product direction and should not be relied upon in making a purchasing decision. The information provided here is for information purposes only and may not be incorporated into any contract. It is not a commitment, promise, or legal obligation to deliver any material, code, or functionality. The development, release, and timing of any features or functionality described for our products remains at ServiceNow's sole discretion.

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2020-11-18 11:20:44
Published:2020-11-04