Class: AddressFieldsWidget

XV. AddressFieldsWidget

Similar in presentation to XV.AddressWidget except that it is used when you want to set each field from a separate attribute of the model, and not all at once using an Address model

new AddressFieldsWidget()

Source:

Extends

Methods

countryChanged()

When the country is changed we want to both do the typical event (to update the model) but also set the country of the state, which will limit its options.
Inherited From:
Source:

done()

Closes the editor popup and saves the address immediately. Note that we don't typically wait for the user to save from the workspace for address changes to get saved to the database.
Inherited From:
Source:

edit()

Opens the editor popup and creates a new address model if necessary.
Inherited From:
Source:

editButtonKeyUp()

Inherited From:
Source:
To Do:
  • Document the editButtonKeyUp method.

editorHidden()

Inherited From:
Source:
To Do:
  • Document the editorHidden method.

inputChanged()

The originator is the field within the address, and the workspace relies on looking at the attr attribute within the originator to know which model field to update. This information is actually kept in a hash in the attr attibute of this AddressWidget, so find it there. Unlike the function that this is overriding, we don't update the model in this kind because this kind is not backed by a model. We send the event up to the workspace to be saved on that model.
Source:

keyUp()

Listens for the enter key
Inherited From:
Source:

mapTap()

Inherited From:
Source:

notify()

Ask a question to the workspace container
Inherited From:
Source:

pickerTapped()

Inherited From:
Source:
To Do:
  • Document the pickerTapped method.

saveAddress()

When each text field is backed by a model attribute on the master model, we never want to do the complicated business logic that operates on an address-wide scale.
Source:
Opens up the search screen for addresses. Restricts on account if this widget has been account-restricted.
Inherited From:
Source:

searchButtonKeyUp()

Inherited From:
Source:
To Do:
  • Document the searchButtonKeyUp method.

setValue(values, options)

Parameters:
Name Type Description
values Object This is a hash of assignments in the form {name: "Toy Truck", line1: "123 Main Street", ... }
options Object
Source:

valueChanged()

Set the contents of the subcomponents based on the value of the model. Note that we pass through the options object, which might have silent:true as an attribute.
Inherited From:
Source: