ModernScreen.disablePredictive()

Overview

Prevents the default prediction engine from processing elements on a page. This should be used when the predictive engine misidentifies portions of a page and gives a false positive. For example, if it mistakenly identifies text as a button that should not be a button.

Call this function when the session scope is entered. Should be used with the event “ParseScreen” to tweak what parts of the default prediction features to disable.

Added in version 2.0.0

Format

ModernScreen.disablePredictive(feature);

Parameter Description Type Required
feature The feature to disable in the default prediction. One of: “Menu”, “Message”, “Button”, “Header”, “Footer”, "All". String Required

Example

Copy
/* Disable default prediction for menu items.
 */
 
ModernScreen.disablePredictive("Menu");
WLEvent.on("ParseScreen", function(eventObject) {
.
.
.
  if (result = match.exec(currentLine)) {
    var value = result[1];
    var label = result[2];
 
    var menuItem = eventObject.createMenuItem(i, 0, label, value + "{AutoEnter}");
    eventObject.add(menuItem);
    eventObject.markScreen(i, result.index, result[0].length);
  }
.
.
.
});