Search

 

Module: Editor

Version: 4.2.1 +

User: Developer

Difficulty: Medium

Introduction

In this exercise we will work with CheckBoxes.

 

Prerequisites

- The Futurama Editor must be installed.
- Futurama Runtime must be installed.
- Completing the tutorial Working with Actions in Futurama first, is recommended. 

 

 

Description 

This is a sequel of the previous exercise ’World Population’. You can download the basis for this exercise (the end-result of the of the World Population exercise) by clicking here. This is a varation to the On and Off exercise. Here we will use the CheckBox object to change the visibility of the different continents.

Assignment

Use CheckBoxes that will turn the visibibity of the series of continents in the graph on/off.

Take the following steps to do so:

  1. Create for every continent a CheckBox in the WebPage and create for every continent a UserVariable Type Boolean in a seperate Node outside the WebPage. 
  2. In the property 'UserVariable' of the CheckBoxes, refer to the corresponding UserVariable.
  3. Set the default value of the UserVariables to 'True'.
  4. Create an Action object in the WebPage and place it above the Graph. In the 'TargetControl property', refer to the GraphConverter.
  5. Create a Node named 'Series' within the Action object. This name is necessary for the path to the Series of the Graph.
  6. Within the Node, create five different reference to the five UserVariables. The names of the references are important. They should consist of the name of a series, followed by a colon and the text 'Visible'. So for instance: "Asia:Visible". 
  7. The now constructed Action means that the property 'Visible' of the corresponding series will be set to the value of the UserVariable. And the value of the UserVariable is determined by whether the checkbox is 'checked' or not.
  8. Save your file and see in your browser if your application works.

Tips

  • The website should respond directly to the user checking or unchecking the checkbox. Therefore the AutoPostBack property of the Checkboxes should be set to 'True'.
  • The scale of the Y-axis is defined automatically, based on the input of series. Therefore the scale of the graph will change when continents are made invisible. To prevent this, set the Maximum of the Y-axis to for instance 10.000.

Solutions

Download

image

You can download our solution for this assignment by clicking the image at the right. (Futurama 4.2.1.2)
Please note that you can very well have a different solution that is just as good as ours.

Variations

Updated: 2013-04-17