DIQ_Result
Purpose
The
DIQ_Result
type represents the outcome of an operation performed with DimensionIQ. This type is commonly returned from host callbacks or internal
operations and it provides a consistent, predictable way for both the DimensionIQWidget and the host
application to communicate whether an operation succeeded or failed, along with optional contextual information.
This type is commonly returned from:
- Host callbacks (eg, save, update, delete operations)
- Validation routines
- Internal service operations
- Persistence or API calls
By standardizing operation results into a single type, DimensionIQ ensures reliable error handling and predictable integration behavior.
Why This Type Exists
DimensionIQ is event-driven and frequently relies on the host applictaion to:
- Persist data
- Validate data
- Authorize actions
- Perform business-specific logic
Because these operations occur outside the core widget, the widget must receive a structured response that clearly communicates:
- Whether the operation succeeded
- If not, why it failed
- Whether user feedback should be shown
DIQ_Result
provides this structured contract.
Properties
| Properties | Type | Required | Description |
|---|---|---|---|
ok | boolean | Yes | Indicates whether the operation was successful, true , or failed, false |
message | string | No | Optional contextual message - used for error details, validation feedback, or informational notes |
Behavioral Expectations
When
ok
is true
:- The operation is considered successful
- The widget will proceed with normal flow
- The messagemay be ignored or optionally logged
When
ok
is false
:- The operation is considered failed
- The widget may:
- Prevent UI state updates
- Revert changes
- Display the provided messageto the user
- Log error for diagnostics
- The messagemay be ignored or optionally logged
Integration Guidelines
When implementing callbacks that return
DIQ_Result
:- Always return a structured object
- Never return nullorundefined
- Do not throw exceptions for expected validation failures, return ok: falseinstead
- Provide meaningful messagevalues whenokisfalse
Summary
DIQ_Result
is the foundational response contract within DimensionIQ. It ensures that all host-driven operations are predictable, safe, communicate clearly,
and integrate consistently.