william_neff_po

Absent Member.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2019-10-28
19:54
245 views
Hello,
I have some javascript that has stopped working after I upgraded to 11.6.1.
The routine below reads a list of checkboxes and hides the ones that are checked, which makes them read only. Also, when the list of checkboxes shows on the page they are checked, the routine would make those items "Unchecked".
Now after the upgrade the checkboxes that should not be checked are checked, and the checkboxes that should be disabled are showing, those are unchecked.
I have stepped through the debuggers on IE and Chrome, the lines of code are getting executed they just aren't displaying the output like the used to.
I have opened an incident with Micro Focus. Just covering all of my bases in case someone else has experienced this behavior and knows of a solution.
var transition_value_var = GetTransitionInternalName();
if (transition_value_var == "DESKTOP_ENVIRONMENT.UPDATE_LOWER_ENVIRONMENTS"
{
var unchecked_add_lower_var = GetFieldValue("ADD_LOWER_ENV_ACCESSED");
if (unchecked_add_lower_var != 1)
{
if (GetFieldWidgetByName) {
var x = $(GetFieldWidgetByName("AVAILABLE_LOWER_ENVIRONMEN")).find(":checkbox(:checked)");
for (i = 0; i < x.length; i++)
{
var y = x.checked
var z = x.value
if ( y == true )
{
$(":[value='"+ x.value +"']").attr("checked",false); // Makes sure the field is unchecked for available items.
//$(":[value='"+ x.value +"']").attr("value",false);
}
else
{
$(":[value='"+ x.value +"']").hide(); //Makes the checked items read only.
}
}
{ show_valid_dates_and_disable_them(); }
}
{add_lower_environments();}
SetFieldValues("ADD_LOWER_ENV_ACCESSED","1");
}
}
I have some javascript that has stopped working after I upgraded to 11.6.1.
The routine below reads a list of checkboxes and hides the ones that are checked, which makes them read only. Also, when the list of checkboxes shows on the page they are checked, the routine would make those items "Unchecked".
Now after the upgrade the checkboxes that should not be checked are checked, and the checkboxes that should be disabled are showing, those are unchecked.
I have stepped through the debuggers on IE and Chrome, the lines of code are getting executed they just aren't displaying the output like the used to.
I have opened an incident with Micro Focus. Just covering all of my bases in case someone else has experienced this behavior and knows of a solution.
var transition_value_var = GetTransitionInternalName();
if (transition_value_var == "DESKTOP_ENVIRONMENT.UPDATE_LOWER_ENVIRONMENTS"
{
var unchecked_add_lower_var = GetFieldValue("ADD_LOWER_ENV_ACCESSED");
if (unchecked_add_lower_var != 1)
{
if (GetFieldWidgetByName) {
var x = $(GetFieldWidgetByName("AVAILABLE_LOWER_ENVIRONMEN")).find(":checkbox(:checked)");
for (i = 0; i < x.length; i++)
{
var y = x.checked
var z = x.value
if ( y == true )
{
$(":[value='"+ x.value +"']").attr("checked",false); // Makes sure the field is unchecked for available items.
//$(":[value='"+ x.value +"']").attr("value",false);
}
else
{
$(":[value='"+ x.value +"']").hide(); //Makes the checked items read only.
}
}
{ show_valid_dates_and_disable_them(); }
}
{add_lower_environments();}
SetFieldValues("ADD_LOWER_ENV_ACCESSED","1");
}
}
1 Solution
Accepted Solutions
william_neff_po

Absent Member.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2019-10-31
20:49
Paul,
Thanks for having a look at it. I will double check your syntax recommendations.
Micro Focus got back to me this morning with:
"There is a mistake in jQuery selector like $(":value=...");
There is no such selectors as $(":value=...").
They should just remove colon before 'value' and use selector $("value=...") instead. "
When I remove the colon before 'value' it worked again.
Normally I would not have troubled MF with a coding issue but because the behavior changed after my upgrade I sent the issue in.
I'm not the best coder, I'm just persistent.
Thanks again,
Regards,
Will
Thanks for having a look at it. I will double check your syntax recommendations.
Micro Focus got back to me this morning with:
"There is a mistake in jQuery selector like $(":value=...");
There is no such selectors as $(":value=...").
They should just remove colon before 'value' and use selector $("value=...") instead. "
When I remove the colon before 'value' it worked again.
Normally I would not have troubled MF with a coding issue but because the behavior changed after my upgrade I sent the issue in.
I'm not the best coder, I'm just persistent.
Thanks again,
Regards,
Will
2 Replies
PM Thompson

Fleet Admiral
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2019-10-31
11:29
( ... just thinking out loud here ...)
The first thing I'd do is check the versions of jQuery in your former and current version of SBM and see if there's any bugs related to ".hide()" or selection logic.
- Line 2 (if) doesn't hava closing right paren for "if" statement.
- Lines 11 & 12 (var y,z) didn't have semi-colon line terminator.
- According the a jQuery manual, the ":checked" selector is more efficient when explicitly prefixed with the INPUT tag, e.g. "input:checked".
- I don't recognize the jQuery syntax for the "(:checked)" part of that but it obviously isn't restricting the search to "checked" checkboxes only, or the rest of the code wouldn't work.
- Line 8 (var x) will set "x" to a collection of INPUT elements that are configured as check-boxes. This list is iterated looking for elements that are "selected" or "checked". Any elements that have the same "value" as any of the checked/selected element(s) are then unchecked / unselected. Any elements that have the same "value" as unchecked/unselected element(s) are hidden.
The first thing I'd do is check the versions of jQuery in your former and current version of SBM and see if there's any bugs related to ".hide()" or selection logic.
william_neff_po

Absent Member.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2019-10-31
20:49
Paul,
Thanks for having a look at it. I will double check your syntax recommendations.
Micro Focus got back to me this morning with:
"There is a mistake in jQuery selector like $(":value=...");
There is no such selectors as $(":value=...").
They should just remove colon before 'value' and use selector $("value=...") instead. "
When I remove the colon before 'value' it worked again.
Normally I would not have troubled MF with a coding issue but because the behavior changed after my upgrade I sent the issue in.
I'm not the best coder, I'm just persistent.
Thanks again,
Regards,
Will
Thanks for having a look at it. I will double check your syntax recommendations.
Micro Focus got back to me this morning with:
"There is a mistake in jQuery selector like $(":value=...");
There is no such selectors as $(":value=...").
They should just remove colon before 'value' and use selector $("value=...") instead. "
When I remove the colon before 'value' it worked again.
Normally I would not have troubled MF with a coding issue but because the behavior changed after my upgrade I sent the issue in.
I'm not the best coder, I'm just persistent.
Thanks again,
Regards,
Will