29.6.4. Standalone mobile application form
When you develop an application form to be used in the mobile client with standalone mode, note general distinctive features of that form on a mobile device and in the mobile client with standalone mode.
These distinctive features include:
- Changes in the form item behavior when the main server is unavailable.
- The possibility to reopen the form if the main server availability changes.
If the main server availability changes when an open form is used, system behavior will depend on a server selected to open the said form:
- You can define a server from which the form is opened using the UsedFormServer property of the client application form.
- A form is opened from the main server:
- The form becomes unavailable.
- The OnMainServerAvailabilityChange form event is called.
- The Close command remains available for the form. If a form has a similar form in the standalone configuration, the Open offline command becomes available.
- A form is opened from the standalone server:
- Behavior of items depends on the value of the OnMainServerUnavalableBehavior form item property. The property can take the following values:
- MakeInaccessible. Items with this property value are disabled as soon as the main server becomes unavailable.
- DontChangeBehavior. Items with this property value remain available. When items related to an external reference are accessed, their behavior is defined by the standalone configuration. Standard selection processing will result in an error. However, standard processing can be redefined.
- Auto is interpreted as :
- MakeInaccessible for items related to an external reference.
- DontChangeBehavior for the other items.
- Behavior of items depends on the value of the OnMainServerUnavalableBehavior form item property. The property can take the following values:
If you click Open offline (or call the ReopenFromOtherServer() method) in the form interface, the following operations are performed:
- For the current form (where the button is clicked), the BeforeReopenFromOtherServer event handler is called. All parameters used to open the current form are passed to the event handler. The developer can modify the list of parameters. If the Cancel parameter is set to True when you exit the event, the form will not be reopened.
- Another (standalone) form is created. Moreover, all server events are triggered for such form.
- The OnReopenFromOtherServer event handler is called for the newly created form. The reopened form and filling parameters are passed to the event handler. If the StandardProcessing parameter of the event handler is set to True , the platform transfers data from the previous form to the new one based on the value of the FillParameters parameter. If the StandardProcessing parameter is set to False, the developer must manually transfer data from the previous form. To generate a list of copied attributes, use the OnReopenFormFromOtherServerFillParameters object. To fill data in the newly created form based on the data from the previous form, use the FillOnReopenFromOtherServer() method.
- The OnOpening event handler is called in the newly created form. All the other events are also called according to the form opening protocol.
- The state of the previous form depends on its opening mode and location:
- An independent form is closed as soon as the newly created form is opened. The OnClose event handler is called. The BeforeClose handler is not called. If the CallbackDescriptionOnClose property is set for the previous form, its value is passed to the new form. A notification is called as soon as the new form is closed.
- The locking form is closed as soon as the new form is closed. The OnClose event handler is called. The BeforeClose handler is not called.
- If a form is placed on the home page, it remains there. The new form will be opened in independent mode.
Before opening a form, remember that:
- The form owner and form opening parameters remain unchanged.
- Attribute values of the following types are not trasferred:
- Chart
- Spreadsheet document
- Planner
- Data of the following types is transferred only if it is fully imported to RAM:
- Table
- Value list
- Value table
- Value tree