The Action Calculator iBloc executes equations using Input widgets without refreshing the page, and displays the results in a Text or Input widget.
Current Version: 1.2.2
Supported iRise Studio Versions: 8.7 – 8.12
Supported Browsers: IE 8.0+, Firefox 3.5+, Safari 4.0+, Chrome 8.0+, iOS Safari, Android (default browser)
Works in iRise iPhone and iPad apps: Yes
What does it do?
- Dynamically performs calculations without requiring a page refresh
- Can be triggered with any event (onLoad, onClick, onChange, etc.) like a standard Action
- Allows you to create your own equations using up to 10 input widgets as variables
- Equations can include numbers, parentheses, and standard operators (+ – * / %)
- The result can be shown in any number of Input and/or Text widget(s)
- The result can also be shown in one of the widgets used as an operand in the equation
- Multiple ActionCalc iBlocs may be used on a single page
- Inputs can contain commas or non-numeric characters (e.g., “$”)
- Answer can be formatted with or without commas and any number of decimal places
How do I use it?
- Drag the iBloc onto the canvas.
- In the Properties panel, enter an equation (default is “a + b”) using numbers, parentheses, numbers, operators (+ – * / %) and/or the letters a – j as variables.
- Select a widget to display the result by clicking the “…” button next to “Result Widget” and choosing a Text or Input widget.
- Enter the desired Precision (number of places after the decimal – default is 2, use 0 for an integer result).
- Place Input widgets onto the page to use as variables for your equation (you can also use any input widgets already on your page).
- Select Input widgets for each variable letter used in your equation, by clicking the “…” button next to each letter variable used and choosing a an Input widget.
- (Optional) Enter a text string or number to display in the result widget if invalid (non-numeric) values are entered into selected Input widgets.
Tips & Tricks
- Initial values for variable and result Inputs can be populated from a Datasheet or entered manually as the default value property of the widget.
- To use values from a Datasheet in your equation that you do not want to display on the screen, use hidden Input widgets.
- To send your result to a Clipboard or Datasheet, use an Input widget inside a form for your result, and submit normally.
- Dynamic spreadsheet-like behavior can be simulated by using result widgets as variable inputs in other ActionCalc iBlocs, and triggering them with onChange events.
- To show the result in one of the widgets used as an operand in the equation, check the box next to “Show result in input widget ‘a’” in the Properties panel. This will display the result in the input that you selected as widget ‘a’. This is useful if you want your calculation to update a widget used in the equation, such as incrementing a number in a ‘spinner-like’ input.