Description:
When using the Dropdown Combo style attribute with validation java script to set other screen attributes according to the dropdown selection, the Dropdown Menu auto-populates values into other attribute fields.
The problem occurs when:
- You configure the dropdown attribute ABOVE the other attributes and select an available value, the other attributes will NOT update according to the selection.
The problem does not occur when:
- You configure the dropdown attribute BELOW the other attributes and select a value, they will change according the selection.
Sample Reproduction of the problem:
- Use the "Modify Group Task"
- Modify the "Modify Group Task"
- Click on TABS
- Expand Profile
- Browse to and select the correct Search Screen(as setup with the attached test XML).
- Edit the selected Search Screen
- Expand the Attribute that will contain the dropdown selector
- Set the Style to "Dropdown Combo"
- Set "Source Of Selection" to Simple Text
- Add One, Two, Three to the "Selection Options"
- Copy in the Validation Java Script (attached)
- Validate On change = Yes
- Move the Dropdown Attribute to the top of the attribute list
- Save and submit the changes to the task
- Access the Modify Group Task
- Using the Dropdown Menu on the attribute does not auto populate the value(s) into all of the other attribute fields.
IF the dropdown attribute is moved BELOW the standard attributes on the Profile Screen, using the Dropdown Menu will auto-populate the value(s) into the other attribute fields.
Solution:
Work around:
- On the 'Title' attribute field:
- Setup the Drop Down box
- Set 'Validate On Change' to YES
- On the 'Department' attribute field:
- Add the following Java Script to the 'Validation JavaScript' box
function validate(FieldContext, attributeValue, changedValue, errorMessage)
{
changedValue.reference = FieldContext.getFieldValue("title");
return true;
}
- Apply all changes and submit the Task.
At that point 'Department' field will be auto-populated with the value from the 'Title' field when the 'Title' field is set using the Drop Down option.
NOTE:
IF you have a shared Corp and Prov Store(Corp=Prov) you will need to use the following Java Script:
function validate(FieldContext, attributeValue, changedValue, errorMessage)
{
changedValue.reference = FieldContext.getFieldValue("eTTitle");
return true;
}