576 views

Description

On Jakarta, g_form.addOption with an empty value adds the label instead.

Steps to Reproduce

 

Example scenario: If you want to add a select box option for the variable Contract Duration to the base system catalog item Apple iPhone 5, this variable should state "No contract" and have an empty value.

  1. Go to /sp to open Service Catalog.

  2. Navigate to Maintain Items > Apple iPhone 5.

  3. Create a new Catalog Client Script for this item that runs onLoad() with the following code:

    function onLoad() {
    g_form.addOption('duration', '', 'No contract');
    }

    For more information, see the product documentation topic Create a catalog client script.

  4. Save it and create another Catalog Client Script that will alert the value of the contract duration selection once it changes.

    function onChange(control, oldValue, newValue, isLoading) {
    if (isLoading) {
    return;
    }
    alert('Value of contract duration is: "' + newValue + '"');
    }

  5. Save it and reload the item.

    If you change the contract duration to "24 Months", you get a message 'Value of contract duration is: twenty_four months'(as expected).

    If you switch to "No contract", you get a message 'Value of contract duration is: No contract'. However, it should not display the label as the option value.

 

Workaround

This issue is under review. To receive notifications when more information is available, subscribe to this Known Error article by clicking the Subscribe button at the top right of the article. If you are able to upgrade, review the Fixed In field to determine whether any versions have a permanent fix.


Related Problem: PRB1080728

Seen In

There is no data to report.

Fixed In

Jakarta Patch 3
Kingston

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2018-03-02 08:46:49
Published:2017-09-07