ApprovalTrail
Namespace: Wisej.Web
Assembly: Wisej.Framework (4.2.0.0)
Displays an approval workflow with participant portraits, decisions, comments, and action requests.
- C#
- VB.NET
public class ApprovalTrail : Control
Public Class ApprovalTrail
Inherits Control
Approved and Rejected notify the application of a requested action. The control never changes workflow states automatically and does not authenticate or authorize the current user. Actions target the first Pending step in collection order. Applications must validate permissions, persist the decision, and update the relevant steps. Stale browser interactions are ignored.
Example:
var trail = new ApprovalTrail { ShowActions = true };
trail.Steps.Add(new ApprovalStep { Text = "Leila Costa", State = ApprovalState.Pending });
trail.Approved += (sender, e) =>
{
// Check permissions and persist the decision before changing the display.
e.Step.State = ApprovalState.Approved;
e.Step.Date = DateTime.Now;
};
this.Controls.Add(trail);
Constructors
ApprovalTrail()
Initializes an empty horizontal trail with comments and actions visible.
Properties
ApprovedText
String: Gets or sets the caption for the approved approval state. (Default: null)
The default is null, which uses the built-in text for the current UI culture. An empty string suppresses the text without disabling the operation.
ApproveText
String: Gets or sets the approve button caption. (Default: null)
The default is null, which uses the built-in text for the current UI culture. An empty string suppresses the text without disabling the operation.
Example:
var control = new ApprovalTrail();
control.ApproveText = "Accept";
control.ApproveText = null; // Restore the built-in localized text.
DefaultSize
Size: Gets the default size of the approval trail.
Focusable
Boolean: Gets or sets whether the trail can receive the focus. The default is false. (Default: False)
Orientation
Orientation: Gets or sets the direction of the participant chain. (Default: Horizontal)
PendingText
String: Gets or sets the caption for the pending approval state. (Default: null)
The default is null, which uses the built-in text for the current UI culture. An empty string suppresses the text without disabling the operation.
RejectedText
String: Gets or sets the caption for the rejected approval state. (Default: null)
The default is null, which uses the built-in text for the current UI culture. An empty string suppresses the text without disabling the operation.
RejectText
String: Gets or sets the reject button caption. (Default: null)
The default is null, which uses the built-in text for the current UI culture. An empty string suppresses the text without disabling the operation.
ShowActions
Boolean: Gets or sets whether actions for the first Pending step are visible. (Default: True)
When several steps are Pending, actions target only the first one. Hiding actions also rejects queued action requests. Visibility is not an authorization check; validate permissions in handlers.
ShowComments
Boolean: Gets or sets whether nonempty participant comments are displayed. (Default: True)
SkippedText
String: Gets or sets the caption for the skipped approval state. (Default: null)
The default is null, which uses the built-in text for the current UI culture. An empty string suppresses the text without disabling the operation.
Steps
ApprovalStepCollection: Gets the ordered steps. Collection and item changes update the client automatically.
TabStop
Boolean: Gets or sets whether the trail takes part in tab navigation. The default is false. (Default: False)
WaitingText
String: Gets or sets the caption for the waiting approval state. (Default: null)
The default is null, which uses the built-in text for the current UI culture. An empty string suppresses the text without disabling the operation.
Methods
Dispose(disposing)
Detaches collection observers without disposing application-owned portraits.
| Parameter | Type | Description |
|---|---|---|
| disposing | Boolean | Whether managed resources can be released. |
OnApproved(e)
Raises the Approved event.
| Parameter | Type | Description |
|---|---|---|
| e | ApprovalEventArgs | The interaction data. |
OnCommentClick(e)
Raises the CommentClick event.
| Parameter | Type | Description |
|---|---|---|
| e | ApprovalEventArgs | The interaction data. |
OnRejected(e)
Raises the Rejected event.
| Parameter | Type | Description |
|---|---|---|
| e | ApprovalEventArgs | The interaction data. |
OnStepClick(e)
Raises the StepClick event.
| Parameter | Type | Description |
|---|---|---|
| e | ApprovalEventArgs | The interaction data. |
OnWebEvent(e)
Dispatches browser interactions to validated event processors.
| Parameter | Type | Description |
|---|---|---|
| e | WisejEventArgs | Client event data. |
OnWebRender(config)
Renders first-level presentation properties and a versioned step snapshot.
| Parameter | Type | Description |
|---|---|---|
| config | Object | Client configuration. |
Events
Approved
EventHandler<ApprovalEventArgs> Occurs when approval is requested for the first Pending step. No state is changed automatically.
CommentClick
EventHandler<ApprovalEventArgs> Occurs when a visible nonempty comment is activated by mouse or keyboard.
Rejected
EventHandler<ApprovalEventArgs> Occurs when rejection is requested for the first Pending step. No state is changed automatically.
StepClick
EventHandler<ApprovalEventArgs> Occurs when a participant is activated by mouse or keyboard.
Implements
| Name | Description |
|---|---|
| IUserData | Provides access to the UserData and Tag properties associated to the component implementing this interface. |
| IBindableComponent | Bindable components implement this interface. |
| IDropTarget | Controls that support drag & drop operations implement this interface. |
| IWisejComponent | All wisej components implement this interface. |
| IWisejControl | All wisej controls derived from the Control class must implement this interface. |
| IWisejSerializable | Allows an object to serialize itself. |