Online documentation - Websydian v6.5 |
Introduction Implementing Other Uses
When specifying a design with multiple Cards in a Deck, it is often necessary to display user values entered or selected by the user in a previous Card. Displaying WML variables is done by specifying the corresponding local fields in the WsyUserOutput variable of the Card Generator function. By doing this, the Card portion of the generated Deck Template will include WML code displaying the specified fields.
MyDeck.SomeCard | local VW ...for VAR ...contains SYS |
MyEntity.Update WsyUserOutput Keys |
option NME ...value SYS |
NewContext No |
In the example above, the key fields of MyEntity will be displayed in the SomeCard Card. This requires that the specified field values have been entered by the user (or selected from a Grid list) in a previous Card within the same Deck.
The NewContext option must be switched off in order for the selected Card to remember the values of the WML variables. By default, the NewContext option on Card Generator functions is set to Yes.
See also the Replacement Markers versus WML Variables section in the Deck Template Generator Background page.
When the value of a CA Plex status field is assigned to a WML variable (by selection from a list box or by selecting a record from a Grid), it is always the literal value of the field that is assigned to the WML variable. Displaying the status field by declaring it as a local field in the WsyUserOutput variable of the Card Generator will result in the literal value of the field being displayed in the Card.
This situation will arise when using the SelectDeck or the WapEditDialog patterns with entities or views containing a status field.
To solve the problem, you may add a new WML variable to be displayed in the Deck Template containing the name of the status value and being assigned together with the setting of the WML variable for the literal value of the field.
When specifying input fields, Websydian Enterprise WAP differs from Websydian for HTML. In Websydian for HTML, input fields are specified by the WebInput variable of the Event Handler functions and the WebInput fields will – unless they are declared as hidden – appear as user input fields in HTML forms on the generated HTML Document Template.
In Websydian Enterprise WAP, input fields to WAP Event Handlers are also specified in the WebInput variable, but these fields will not automatically appear as user input fields in the generated WML Template. In Websydian Enterprise WAP, user input fields also have to be specifically declared in the WsyUserInput variable of the Card Generator functions. User input fields are specified at Card-level (and not per Event Handler) and in this way, several Event Handlers could actually share the same user input fields.
When a WML Deck is sent to a WAP device, the device will always show the first Card in the Deck. Websydian contains a WSYD First card option to specify that a specific Card should be the first in the Deck:
MyDeck.MyFirstCard | option NME ...value SYS |
WSYD First card Yes |
In the example above, MyFirstCard is the first Card in the Deck Template generated from the MyDeck function.
WAP Event Handlers and Jump functions specified in the Deck Template section may be overwritten at Card-level. According to the WML Specification, an action defined in the Template section of a WML Deck will be overwritten by an action at Card-level, if the WML name of the two actions is the same. The name of an action is determined by the Plex object name of the corresponding WAP Event Handler or Jump function (see also the Specify Name of WAP Event Handler and Specify Name of Jump sections).
By applying a special NOOP (no operation) option, it is possible to omit menu points ‘inherited’ from the Template section. The triples below will remove the CommonAction menu point from a Card even though a CommonAction WAP Event Handler or Jump has been specified in the Template section.
MyCard.CommonAction | option NME ...value SYS |
WsyNoop Yes |
According to the WML standard, WML variables will always be substitued if they contain a value. If the NewContext option is set to Yes (which is the default in Websydian Card Generators), all WML variables are cleared and no substitution of WML variables will happen.
A side-effect of having the NewContext option set is that the call stack is also cleared hence not allowing jumping back (see the Specify Back Option of the Other Uses of the Jump Function page).
See also the Initializing Input Fields from WML Variables section in the Other Uses of the Deck Template Generator page.