The setData defines all the fields/widgets to submit to a URI address (using loadURL or loadGui attribute).
Note that instead of using a comma we use a URL encoded '%2c' ASCII equivalent, otherwise when the method gets looked up
it will incorrectly search for a method with 'x' number of parameters instead of a single parameter
Before filling in the setData with the widget names, you would need to first set them using setName.
In the Edit control we name the widgets f1, f2 and f3.
To be able to reference all the widgets that get submitted they first need to be named!
To name them we use the setName attribute, this will be used to reference the Widget.
In the button addActionTarget we call the 'status' Widget's loadGui attribute.
Since the widget 'status' is responsible for loading the gui it would also look locally to see
if any data had been set. So the setData has to be on the 'invoked' widget.
The loadGui's update is set to true, in other words the loaded XML file will ONLY update already existing widgets
that have a matching setName attribute.
The middleware script, submitform.php
// do some processing on the retrieved values
<Widget setName="status" setLabel="processed"/>
The submitform.php script is purely a processing script. It retrieves the data, does some processing and returns a string
indicating the state of the widget
Since this is an update script (loadGui flag set the update to true), we do not need to add any extra style information,
since the widget will retain all of its previous attributes and we will only UPDATE the given attributes
If we wanted to include a dynamic message update by the script we can add this by changing the setLabel attribute .. setLabel="<?php echo $process_result; ?>" ..
We update the setData with the new field 'f4', this is the name assigned to the checkbox.
When the file is submitted the checkbox will be assigned either a 1 or 0.
A '1' if there is a checkmark.
A '0' if there is NO checkmark.
The default URI request (if the submit button is pressed right away) will look like this ... ..submitform.php?f1=one&f2=one&f3=one&f4=0
Let's add two other widgets, radio button 'f5' and radio button 'f6'.
They are grouped (setGroup) to radio1, this insures that only one or the other widget is at most selected.
They pass the same value as a checkbox, either a '1' if selected or a '0'.
Let's say we select the radio button f5, then the URI we will get will look like this ... ..submitform.php?f1=one&f2=one&f3=one&f4=0&f5=1&f6=0
The setDataGetSelected instructs the widget that all button types (button, checkbox and radio) are only passed
in the URI request string IF they are selected (value set to 1), otherwise they are ignored
Let's say we select the checkbox button f4 (a value of 1), the the URI we will get will look like this ... ..submitform.php?f1=one&f2=one&f3=one&f4=1
The radio buttons since they were not selected were not included in the request