Versions Compared
compared with
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Description
Submit buttons are aesthetically similar to normal buttons but their behaviour differs from normal buttons with respect to the following:
- They allow data captured on the view to be submitted to a unit
- They do not allow for usage without an action function binding
Code Block | ||
---|---|---|
| ||
unit Workouts;
Workout uWorkout;
void init() {
uWorkout = Workout:new();
}
.
.
.
DSL_VIEWS saveWorkout() {
uWorkout.endTstamp = Date:now();
uWorkout.save();
return DSL_VIEWS.Workouts;
} |
Example
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<textarea label="input.workout_comments"> <binding variable="uWorkout"> <attribute name="comments"/> </binding> </textarea> <submit label="button.save_workout" action="saveWorkout"/> |
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
unit Workouts; Workout uWorkout; void init() { uWorkout = Workout:new(); } . . . DSL_VIEWS saveWorkout() { uWorkout.endTstamp = Date:now(); uWorkout.save(); return DSL_VIEWS.Workouts; } |
Code Block | ||
---|---|---|
| ||
button.save_workout = Save workout |
Additional Mentions and References