Online documentation - Websydian v6.1 |
InsertCard provides basic functionality for inserting a record in a database table. InsertCard contains an Insert WAP Event Handler function which performs basic validation and calls insert processing at the database server.
Example:
MyInsertDeck | is a FNC | DeckGenerator |
includes FNC | MyInsertCard | |
MyInsertDeck.MyInsertCard | is a FNC | InsertCard |
replaces VW ...by VW |
UIBasic.Insert EntityX.Update |
|
replaces VW ...by VW |
UIBasic.Detail EntityX.Update |
In order to use the InsertCard pattern, it is necessary to incorporate the Card Generator in a Deck Generator and replace the UIBasic.Insert and the UIBasic.Detail views (the UIBasic.Detail view specifies the fields to be included in the Card Template).
After the Insert event, a new WML Deck must be displayed. In this way, a call statement to a Deck Generator must be specified in the 0 call to build of document edit point of the Insert WAP Event Handler function
The Insert WAP Event Handler as well needs to be declared by a calls-triples from the WAP Dispatcher function.
If error handling functionality is required, it must be added to the MyInsertCard.Insert Event Handler action diagram by calling an Error Deck function. The InsertCard.Insert WAP Event Handler pattern already inherits from the EventHandlerWithValidation pattern, which will invoke any validation functions called by validated by and checked by triples.
By default, the NewContext option is set to Yes. This will clear the value of all WML variables, and it will also clear the call stack, so that the Back Jump scoped under the InsertCard does not remember the previous Card in the Deck. To make the Back Jump work, a calls-triple must be specified to the Card Generator function to return to.
Example:
MyDeck.MyInsertCard.Back | calls FNC | MyDeck.OtherCard |
After the Insert event, a new WML Deck must be displayed. In this way, a call statement to a Deck Generator must be specified in the 0 call to build of document edit point of the Insert WAP Event Handler function.