Here is an attempt to list the possibly desired widget states. Please help with refining the list, selecting which states we should support in Cocoon Forms, and deciding how to mark these selected state.
Please also consider how should we handle displaying the same data in different states in two or more places on the form, such as simultaneously in an editable input box and as inline output? Some options:
- Keep the "output" styling
- Make for form designer use ValueChangedEvent's to mirror the value to multiple widgets
- Others?
Key to tables below:
Column |
Values |
... |
|
Output to client |
O=Output |
_=Do not output |
|
Read from request |
R=Read |
_=Do not read |
|
Show to user |
S=Show |
H=Hide |
|
Field or inline data |
F=Field |
I=Inline |
|
Enable user input |
E=Enable |
D=Disable |
Displayed data:
Output |
Read |
Show |
Field |
Enable |
Example usecase |
|
O |
_ |
S |
I |
N/A |
Read-only inline data, like "output" widget |
|
O |
R |
S |
F |
E |
Normal "enabled" field |
|
O |
_ |
S |
F |
D |
Securely "disabled" field |
|
_ |
R |
S |
F |
E |
Password without echo from server |
|
_ |
R |
S |
F |
D |
"Disabled" field set by client-side js |
Hidden data:
Output |
Read |
Show |
Field |
Enable |
Example usecase |
|
O |
R |
H |
F |
N/A |
Data to communicate with client-side js |
|
O |
_ |
H |
F |
N/A |
Data to drive client-side js |
|
_ |
R |
H |
F |
N/A |
Data generated by client-side js |
Weak options: (might be useful, but harder to justify if they require extra coding)
Output |
Read |
Show |
Field |
Enable |
Example usecase |
|
O |
_ |
S |
F |
E |
Ignored "enabled" field for demo/preview |
|
_ |
_ |
S |
F |
E |
Blank "enabled" field for demo/preview |
|
_ |
_ |
H |
F |
N/A |
Stub for use only by client-side js? |