Online documentation - Websydian v6.0

Users Guide | Patterns Reference | WebsydianExpress | Search

 

UpdateDeck Function

UpdateDeck is a Deck Generator utility pattern designed to implement updating the non-key fields of a selected database record.  UpdateDeck corresponds to the WebUpdatePage pattern for HTML development, and when applied the UIBasic.Update and UIBasic.Detail views must be replaced with the database views on which the update operation is performed.

The UpdateDeck pattern is called with the key fields of the updated entity as parameters.

The UpdateDeck pattern contains an UpdateCard Card Generator function scoping an Update WAP Event Handler (and a disabled Back Jump function).

Example 1:

MyUpdateDeck is a FNC UpdateDeck
replaces VW
...by VW
UIBasic.Update
MyEntity.Update
replaces VW
...by VW
UIBasic.Detail
MyEntity.Fetch
replaces FNC
...by FNC
ErrorDeck
MyErrorDeck
MyUpdateDeck.UpdateCard name NME Change MyEntity
MyDispatcher calls FNC MyUpdateDeck.UpdateCard.Update

After the Update WAP Event Handler has been triggered, a new Deck Generator function needs to be called.  This call must be specified in the Call deck generator edit point of the Update WAP Event Handler function.

Exampe 2:

Often, not all non-key fields in a selected database record should be updatable.  Some fields may be shown as read-only with the old value kept unchanged by the update operation, while other fields are not shown at all (old field values also kept unchanged).

In the example below, the UpdateDeck is applied with FieldA displayed as read-only and FieldB not displayed at all.  The remaining non-key fields are updatable by the user.

MyUpdateDeck is a FNC UpdateDeck
replaces VW
...by VW
UIBasic.Update
MyEntity.Update
replaces VW
...by VW
UIBasic.Detail
MyEntity.Fetch
replaces FNC
...by FNC
ErrorDeck
MyErrorDeck
MyUpdateDeck.UpdateCard local view VW
...for VAR
...contains SYS
...omits FLD
MyEntity.Fetch
OmitDetailsFields
Nonkey
FieldB
local view VW
...for VAR
...contains SYS
...omits FLD
...omits FLD
MyEntity.Update
WsyUserInput
Nonkey
FieldA
FieldB
name NME Change MyEntity
MyUpdateDeck.UpdateCard.Update local FLD
...for VAR
FieldA
Hidden
local FLD
...for VAR
FieldB
Hidden
MyDispatcher calls FNC MyUpdateDeck.UpdateCard.Update