Display views show a terms value while edit views show it's token
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
z3c.form |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
In the update method of RadioWidget and Checkbox widget the token of a term is assigned to the variable that gets shown in the input form. But the "displayValue" method of SequenceWidget, which is a parent class of all these widgets returns the value of a term for display. This leads to the situation that in the edit form the token is displayed while in the non edit view the value is shown.
This only happens if no title for the term is defined. If the term is titled, the right thing (ie. show the titlel) is done in both views.
IMHO both edit and display views should show the same string. I don't particularly care if it's the value or the token. There might be arguments either way. I have a weak preference to show the token.
Changed in z3c.form: | |
status: | Fix Committed → Fix Released |
I didn't take a closer look at the code but it looks correct to me if the value get used for display or title for title tokenized terms. Because a token is not or not allways human readable for display in HTML. A token is only an internal representation which allways makes sure it can be used as POST value. This token is important for values which can't get used directly in forms e.g. a python object etc.