CSBL - widgetNumericKeyboard (IN/OUT)

 

6.10.1 widgetNumericKeyboard as a Writing widget

First of all, an existing widget must be identified in the dashboard to be the target of the triggedered action, of which the id <TARGET_WIDGET_NAME> must be noted. In this example the target is a WidgetSingleContent.
The JS function to be inserted in the appropriate box (in more options) of the current widgetNumericKeyboard is of the following type:

function execute() {
    $('body').trigger({
    type: "showSingleContentFromExternalContent_<TARGET_WIDGET_NAME>",
    eventGenerator: $(this),
    targetWidget: "<TARGET_WIDGET_NAME>",
    color1: "#e8a023",
    color2: "#9c6b17",
    widgetTitle: "ShowDouble",
        passedData: { "dataOperation": param}
     });
}

The param variable consists of the input value generated by the change of state of the widgetNumericKeyboard widget, when you click on the "confirm" button.
You can send it in passedData, or use it to perform operations in javascript:

function execute() {
    $('body').trigger({
       type: "showSingleContentFromExternalContent_<TARGET_WIDGET_NAME>",
       eventGenerator: $(this),
       targetWidget: "<TARGET_WIDGET_NAME>",
       widgetTitle: "ShowDouble", 
       passedData: { "dataOperation": param*2}
     });
    }
}

In this example we want the target widget to show the double value compared to the one inserted in the current widgetNumericKeyboard.

The passedData field can be:

passedData: {
     "dataOperation": <VALUE>
}

6.10.2 widgetNumericKeyboard as a Reading widget

It is possible to send a numeric value from another widget as a read parameter in the widgetNumericKeyboard using a JavaScript function inserted in the CKEditor of the writing widget

In this example, you can send a parameter from an impulse button widget to a numeric keyboard  widget. In the CKEditor of the writing widget this execute function must be written whose type must be written as follows.

showNumericKeyboardFromExternalContent_<TARGET_WIDGET_NAME>

 function execute() { 
  type: "showNumericKeyboardFromExternalContent_w__1540_widgetNumericKeyboard10039",
    eventGenerator: $(this),
    targetWidget: "w__1540_widgetNumericKeyboard10039",
    color1: "#e8a023",
    color2: "#9c6b17",
    widgetTitle: "ShowData", 
    passedData: { "dataOperation": param}

}

 

The passedData field can be:

passedData: {
     "dataOperation": <VALUE>
}

              

 

 

CSBL - widgetNumericKeyboard (IN/OUT) | Snap4City

Error

×

Error message

  • Unable to send e-mail. Contact the site administrator if the problem persists.
  • Unable to send e-mail. Contact the site administrator if the problem persists.
  • Unable to send e-mail. Contact the site administrator if the problem persists.
  • Unable to send e-mail. Contact the site administrator if the problem persists.
  • Unable to send e-mail. Contact the site administrator if the problem persists.
  • Unable to send e-mail. Contact the site administrator if the problem persists.
  • Notice: Trying to get property of non-object in user_is_logged_in() (line 1576 of /var/www/html/drupal/modules/user/user.module).
  • Notice: Trying to get property of non-object in user_is_logged_in() (line 1576 of /var/www/html/drupal/modules/user/user.module).
  • Notice: Trying to get property of non-object in og_field_access() (line 578 of /var/www/html/drupal/sites/default/modules/og/og.module).
  • Notice: Trying to get property of non-object in user_access() (line 806 of /var/www/html/drupal/modules/user/user.module).
  • Notice: Trying to get property of non-object in user_access() (line 818 of /var/www/html/drupal/modules/user/user.module).
  • Notice: Trying to get property of non-object in user_access() (line 819 of /var/www/html/drupal/modules/user/user.module).
  • Notice: Trying to get property of non-object in user_access() (line 825 of /var/www/html/drupal/modules/user/user.module).
  • Notice: Trying to get property of non-object in user_access() (line 828 of /var/www/html/drupal/modules/user/user.module).
  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/drupal/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/drupal/includes/bootstrap.inc).
  • Error: __clone method called on non-object in og_user_access_entity() (line 2249 of /var/www/html/drupal/sites/default/modules/og/og.module).
The website encountered an unexpected error. Please try again later.