background image
C H A P T E R 2 2
Transport Interface
22-30
Using the Transport Interface
Positioning Elements in the Lower Portion of the Routing Slip
22
The height of the lower portion of the routing slip is controlled by the
bottomIndent
slot. Placing your own user interface elements in this portion of
the routing slip is complicated by the fact that the format picker may or may not be
inserted by the system. It is included only if there is more than one format for the
item. Also, the system performs animation on the routing slip, changing the
location of the bottom bounds.
Any user interface elements you add to this portion of the routing slip must be
positioned relative to the bottom of the slip dynamically, at run time. You can
determine the position of the bottom of the slip by calling the routing slip method
BottomOfSlip
. An alternative method of positioning elements dynamically is to
make them sibling bottom-relative to the last child of the routing slip proto, which
is the Send button.
Note that only the first child element you add needs to follow these rules.
Additional elements can be positioned sibling-relative to it.
Using Owner Information
22
The
protoFullRouteSlip
view sends the
OwnerInfoChanged
callback
method to itself if the user changes the selection of owner name or worksite
location in the sender pop-up view. The
OwnerInfoChanged
method provides
the chance to update any information in the routing slip that depends on data in the
sender's current owner card or worksite. In addition, the
fromRef
slot in the item
will probably need to be updated with new sender information. For more informa-
tion about setting the
fromRef
slot, see the section "Obtaining an Item Frame"
beginning on page 22-13.
In your
OwnerInfoChanged
method, you can obtain any changes by checking
variables in which you are interested in the user configuration data, using the
GetUserConfig
function. For example, the area code at the user's location can
be found by using this code:
GetUserConfig('currentAreaCode);
For a list of variables in the user configuration data, see "User Configuration
Variables" (page 16-101) in Newton Programmer's Reference.
One issue to consider when saving items in the Out Box for later transmission is
when to read the sender's owner card and worksite information. In general, data
from the owner card should be obtained from the current persona at the time the
item is queued by the user. Such information might include the sender's name,
return address, credit card information, and so on.
However, if you use worksite information (for example, for addressing), you may
want to wait until the item is actually transmitted to obtain the most current
information based on the user's current worksite setting, and modify addressing
© 2007-2017, o7 studio » при воспроизведении материала сайта ссылка обязательна