Edit Mode is a property included in WorkWith and SubWorkWith nodes that allows the developer to choose a different behaviour when editing instances inside that interface. This property's values are "Standard", "Master-Detail", and "Popup".
This property was added in K2BTools 10. Before that, K2BEntityServices generated the "Standard" option only.
|Edit Mode = "Standard" example. Work With and Entity Manager interfaces are shown in different screens.
In this mode, an EntityManager interface is created, and that interface is called to Insert, Display, Update, or Delete records. The Entity Manager is Mandatory: If the Entity Manager is not generated, the "Standard" mode cannot be generated.
|Edit Mode = "Master-Detail" example
In this mode, the WorkWith screen is divided in two areas. The first one contains the contents usually found in those interfaces, while the second one contains a Web Component that will contain the transaction in runtime. The Web Component is empty when the user enters the interface, and a "Select Record" message is shown. The Insert, Display, Update, and Delete actions trigger an update on the Web Component, to show the transaction in the correct state. The EntityManager may be present or not. If present, it will be accesible using the "More Information" action at the bottom of the Transaction's pane.
|Edit Mode = "Popup" example
In this mode, the WorkWith interface is equal to the Work With interface in the "Standard" mode. The main difference is that in this case, when executing the "Insert", "Display", "Update" and "Delete" actions the transaction is opened in a Popup screen instead of the EntityManager. The EntityManager may not be present in the instance. If present it will be used only in Autolinks.
Availability: Since K2BTools 13.0
|Edit Mode = "Inline" example
In this mode, WorkWith and SubWorkWith interfaces use their main grid to display, insert, and update information.
When the insert action is executed a new line appears in the grid. When the update action is executed, non-readonly fields are shown as enabled so that the user can change their values and save them. When the delete action is executed, the item is deleted without navigating to the transaction (using the Business Component).
To use this Edit Mode, the transaction must be a business component.
The following guidelines are presented to help choose between edit modes. They are not mandatory rules, the developer should choose the best interface for each scenario based on the advantages of each mode.
Amount of attributes
(Amount of attributes in transaction)
This mode can handle transactions with a significant number of attributes.
The interface may be too complex to handle transactions with few attributes.
|This mode is well suited to transactions with few parameters.
|This mode can handle transactions with either few or a lot of attributes equally well.
|This edit mode is suited to transactions with few attributes as they must fit in the grid for this mode to work properly.
Amount of relevant related transactions
This mode can handle any number of relations using the EntityManager interface.
Suitable if the instance's related transactions are used frequently.
This mode can handle related transactions, but its usage is more complex (the user must select the item, and then navigate to the EntityManager).
Suitable if the instance's related transactions are not used frequently, or are used only by a subset of the application's users.
|This mode does not handle related transactions natively.
|This edit mode is well suited to transactions with many related transactions as the user can navigate easily to the Entity Manager to see them.
Settings-level: The K2BEntityServices Settings object contains the properties: "Default Edit Mode", "Default Insert Title", "Default Update Title", and "Default Delete Title". These properties determine the default values in the following levels.
Transaction-level: Transactions contain the properties: "Edit Mode", "Insert Title", "Update Title", and "Delete Title". The values for these properties are calculated from the corresponding settings-level properties. In the "Title" properties, the string "<TrnDescription>" will be substituted by the transaction's Description. The title properties are used in the following locations: The title for the popup screen when using Popup edit modes, and the title for the Transaction Pane when using Master-Detail edit modes.
Instance-level: Instances contain the property "Edit Mode" in WorkWith and SubWorkWith nodes. This property's value is loaded from the "Edit Mode" property in the transaction associated with the node.
Settings-level: The K2BEntityServices Settings object contains the properties: "Default Pop Up Autoresize", "Default Popup Height", "Default Popup Width", and "Display Action In Pop Up". These properties determine the default values in the following levels.
Transaction-level: Transactions contain the properties: "Default Pop Up Autoresize", "Default Popup Height", and "Default Popup Width". The default values are loaded from the corresponding properties at a settings level.
Instance-level: When the Popup Edit Mode is selected in an instance, properties are added in the Standard Actions node. The added properties are: "Pop Up Autoresize", "Popup Height", "Popup Width", and "Use Popup In Display Node". The first three properties load their default value from the corresponding properties at a transaction level. The "Use Popup In Display Node" default value is calculated from the "Display Action In Pop Up" property in K2BEntityServices Settings, depending on the existence of an EntityManager in the pattern instance.
Settings-level: The K2BEntityServices Settings object contains the properties: "Include More Information Action", "More Information Action Caption", "No Item Selected Default Caption", and "Use Component In Display Action". The first properties configure the "More Information" action shown in the bottom of the transaction pane, the third one contains the string shown when no records were selected in the UI, and the last one determines the behaviour of the "Display" action.
The settings object also contains "TwoPaneUpdate" and "TwoPaneDelete" nodes to configure the Update and Delete actions shown in the transaction pane when it is in Display mode.
Instance-level: When the Master-Detail Edit Mode is selected in an instance, properties are added in the Standard Actions node. The added properties are: "Show Display Mode In Component", "Master-Detail Update", "Master-Detail Delete", and "No Item Selected Caption". The first property determines if the Display action should be associated to the Transaction pane or directed to the EntityManager interface. The second and third determine the generation of the Update and Delete actions in the Transaction Pane. The last one allows the developer to customize the message for that interface. These properties' default values are loaded from the settings object.
Note: When using the Master-Detail edit mode, a new basic layout object must be selected. This is necessary as the default layout object does not contain the definition for some of the UI components, such as the Web Component or the "More Information" action. This Layout Object can be customized as all other layout objects.