Version: 4.2.1 +
In this exercise we will work with CheckBoxes.
- The Futurama Editor must be installed.
- Futurama Runtime must be installed.
- Completing the tutorial Working with Actions in Futurama first, is recommended.
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.
Use CheckBoxes that will turn the visibibity of the series of continents in the graph on/off.
Take the following steps to do so:
- 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.
- In the property 'UserVariable' of the CheckBoxes, refer to the corresponding UserVariable.
- Set the default value of the UserVariables to 'True'.
- Create an Action object in the WebPage and place it above the Graph. In the 'TargetControl property', refer to the GraphConverter.
- Create a Node named 'Series' within the Action object. This name is necessary for the path to the Series of the Graph.
- 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".
- 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.
- Save your file and see in your browser if your application works.
- 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.
You can download our solution for this assignment by clicking the image at the right. (Futurama 184.108.40.206)
Please note that you can very well have a different solution that is just as good as ours.