Ticket #205 (closed task: fixed)

Opened 4 years ago

Last modified 3 years ago

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:1 Changed 4 years ago by jgou

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 ?

comment:2 Changed 4 years ago by mpo

get/setBoundHTML() ?

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:

  1. applyValue() (apply to the html view) - retrieveValue() (retrieve from the html page)
  2. writeUserValue() (to the HTML) - readUserValue() (from the page)
  3. leave as is (duh)

comment:5 follow-up: ↓ 6 Changed 3 years ago by mpo

I vote for (2) write/read

comment:6 in reply to: ↑ 5 Changed 3 years ago by jgou

  • Priority changed from minor to major

Replying to mpo:

I vote for (2) write/read

+1

comment:7 Changed 3 years ago by freya

  • Status changed from new to closed
  • Resolution set to fixed

renamed to writeUserValue/readUserValue in r1479 and r1480

Note: See TracTickets for help on using tickets.