There is a bug in Xwidgets that causes the evaluation of boolean conditional statements to process incorrectly. True or False are both ignored.
Javascript in general uses boolean values of zero (0) and one (1) to represent true or false. You can use if () {} statements to probe the values:
Code:
if (playlistFrame.visible === false) {
mediaPlayerHelp.visible = true;
}
if (playlistFrame.visible === 0) { // also false
mediaPlayerHelp.visible = 1;
}
Note: Any non-zero value (1, 2, 3, 4, -1) will also evaluate as TRUE.
If the visibility of an object is set in the Xwidget IDE using the radio button then it should be possible to test the visibility in Microsoft's (Xwidget's) jscript:
Code:
if (playlistFrame.visible === false) {} ;
if (playlistFrame.visible === true) {} ;
These should be valid, however, in Xwidget, checking to see if a value is true or false will result in an incorrect response:
Code:
//if (playlistFrame.visible === false) { FAILS
//if (playlistFrame.visible == "0") { works
//if (playlistFrame.visible == 0) { works
//if (playlistFrame.visible === 0) { works
//if (playlistFrame.visible === true) { FAILS
//if (playlistFrame.visible == "-1") { works
//if (playlistFrame.visible == -1) { works
//if (playlistFrame.visible === -1) { works
Javascript typically uses boolean values 1 or 0 as boolean whereas Xwidget uses 0 or -1, this is not really an issue as any non-zero value (1, 2, 3, 4) should also evaluate as true. However, this is not the case with Xwidget and only a numeric value of -1 (minus one) indicates a true value. This is against standard practice with javascript.
In addition, and much, much worse, there is a bug in Xwidgets (or Jscript) that means even a value of "true" is NOT valid:
Code:
if (playlistFrame.visible === true) { FAILS
This is crazy!
You will have to replace all your conditional statements that check for true or false with 0 or -1.
Code:
if (playlistFrame.visible === -1) { works