Ticket #205 (closed task: fixed)
Rename get/setUserValue
| Reported by: | bruno | Owned by: | mpo |
|---|---|---|---|
| Priority: | major | Milestone: | 0.4 |
| Component: | modules/kauri-forms | Version: | trunk |
| Keywords: | Cc: |
Description
The control methods getUserValue() and setUserValue() are somewhat confusing as they don't perform a similar function to get/setWireValue(), thus they don't serve to get or set the control value in user-format.
They are a contract between the Control base class and the concrete control implementations to get or set the value in the widget in the DOM/HTML tree.
So I'd like to see them renamed to something else. My current idea is get/setWidgetValue().
Change History
comment:3 Changed 4 years ago by bruno
The binding is the connection between a control and one or more DOM nodes. Applying the value to some bound element is different from performing the binding itself.
Since we don't have a widget-formatter, I think the argument about the widget-format is a bit far fetched. The user-format is actually the wiget-format.
Some other possibilities:
setValueToDom() -- getValueFromDom()
setValueToHtml() -- getValueFromHtml()
setValueToUser() -- getValueFromUser()
applyValue() -- retrieveValue()
Hmmm, maybe the get/setUserValue() wasn't too bad after all :-)
comment:4 Changed 3 years ago by mpo
Let's do a last call to vote/decide:
- applyValue() (apply to the html view) - retrieveValue() (retrieve from the html page)
- writeUserValue() (to the HTML) - readUserValue() (from the page)
- leave as is (duh)
get/setWidgetValue() are less confusing, but still: they don't serve to
get or set the control value in widget-format AFAIK.
If I'm not mistaken, they perform the binding with the widget in the
DOM/HTML tree, so maybe the method names should reflect that ?