Information on Configuring Buttons
ButtonsButtons need to be managed very carefully as the structure in the buttons database table is quite brittle.
If you stuff it up, that table will need to be rebuilt!!!
Each button has the following fields.
id: the record_id for the button, the absolute reference to the button that is made use of in the "enable" field.
Name: the displayed name for this button.
Group: Each button belongs to a group. Only one button can be selected within a group. The group titled "Drink" is a mandatory group and are the primary buttons displayed on the left hand group. "Drink" buttons have an associated "enable" field that informs us what buttons should be enabled when the the primary drink buttons is selected.
Enable: Used only on buttons in the "Drink" group. This is a list of buttons to show when the primary drink button is selected.
Seq: The order in which buttons are displayed within the group.
The logical flow of button selection and display.
Assumptions:
All buttons are on the browser page, just shown or hidden.
The "Drink" group buttons are in the left column.
All other buttons are on the right column.
Each "Named" group with their buttons are shown as sections in alphabethical order. The group name is shown as the section title.
The buttons within each group are ordered as per the "Seq" (Sequence) field.
Only one buttons can be selected within a Group - both left and right hand side.
Flow:
On selection of a drink button (e.g. Cap), we highlight that button in the display and place the button name (Cap) into the drink field in the submit area. We then look to see what buttons have been requested to be displayed by looking in the "Enable" field (10,11,12). We then show buttons with that id (button id=10 => Group=Strength, title=1/2), id=11 => Group=Strength, title=1/4), id=12 => Group=Temperature, title=Extra Hot). We then show (unhide) these button on the screen. At the same time, any buttons shown also have their Section (=Group) title shown.
On selection of a DIFFERENT drink button, everything is cleared and the logic is redone.
On slection of a right hand button, the button is highlighted and the title is added to the into the drink field in the submit area.
Right hand side buttons can be deselected.
On selection of a different PERSON, everything is cleared and starts over again.