BluKavantUI Design system
PATTERNS

Edit & save

Make drafts visible, save changes together, and preserve work after a failure.

EDIT & SAVE / IMPLEMENTATION RECIPE

Make a batch save a real transaction.

Let a team edit and reorder board cards, review the pending changes, and save once. A rejected save keeps the draft. An accepted response becomes the new baseline.

Use this when several related edits should commit together. For an immediate-save workflow, expose that behavior explicitly instead of keeping an unrelated Save button.

ACCEPTED BASELINEPrepare handover · To do
LOCAL DRAFTPrepare handover · In progress
SAVE REQUESTRequestId + Cards + Changes
Accepted → replace baselineRejected → keep draft + retry
WORKING COMPOSITION

A pending batch, an explicit rejection, a retry and a new accepted baseline.

Real BluKavantUI components, with a small application controller. Data and save responses are simulated in this page; reload resets the example.

Loading the interactive recipe…

Try this sequence
  1. Open Prepare handover, change its title or column, and Apply changes in the editor.
  2. Check Reject the next save, then choose Save changes on the board.
  3. The failure leaves your edit and dirty count in place. Retry Save changes; this time it succeeds.
  4. Make another edit, then Discard changes. The last accepted version returns.
IMPLEMENT THE WORKFLOW

Build edit & save into your application.

Kanban ↗

Owns editing, reordering, the dirty count and the Save/Discard lifecycle.

  1. Let Kanban own the draft

    AllowEditing and EnableBulkSave expose the built-in editor and toolbar. Do not add a competing Save button or persist every CardsChanged event.

  2. Submit the full ordered set

    SaveRequested provides RequestId, the complete Cards list and Changes. Save the submitted snapshot, including cards hidden by search.

  3. Validate atomically

    Your service rechecks permissions, allowed moves and record versions. Either commit the whole batch or reject it; a success acknowledgement must describe what actually committed.

  4. Acknowledge every result

    Return the same request ID with success or failure. On success, return the full canonical list, including real IDs for newly created cards. On failure, leave the draft available.

State / contractImplementation
Draft notificationCardsChanged updates screen state. DirtyChanged can drive a navigation guard. Neither is a persistence acknowledgement.
SaveRequestedrequestId: string; cards: KanbanCard[]; changes: KanbanChange[]. Changes include Before, After and positions.
Successupdate({SaveResultRequestId, SaveResultSuccess:true, SaveResultCards: fullCanonicalCards}).
Failure / conflictupdate({SaveResultRequestId, SaveResultSuccess:false, SaveResultMessage}). Explain conflicts without overwriting the local draft.

Web implementation

Call mount(host, columns, cards, saveBoard). Implement saveBoard as one authorized, version-checked transaction returning the complete canonical card list. The example adapter waits briefly and can reject one attempt; it never calls a real persistence endpoint.

Install Community and the required Pro add-on for Grid or Kanban recipes, import @blukavantui/community/styles.css and @blukavantui/pro/kanban.css, and use a connected host element. The companion CSS styles the surrounding fields, navigation and status messages.

Keep the recipe and shared.ts together; TypeScript resolves the recipe’s ./shared.js import. Add class="recipe-demo" to your host. Supply your records and backend callback as the mount arguments. The downloads use Community 1.0.0 and Pro 1.0.0 imports; the live demo retains its previously verified SDK 0.9.0 runtime.

View the TypeScript recipe
import { createKanban } from '@blukavantui/pro/kanban';
import type {KanbanCard, KanbanColumn, KanbanChange} from '@blukavantui/pro';
import { node, status } from './shared.js';
export type SaveBoard = (requestId: string, cards: KanbanCard[], changes: KanbanChange[]) => Promise<KanbanCard[]>;
export function mount(host: HTMLElement, columns: KanbanColumn[], cards: KanbanCard[], save: SaveBoard) {
  const target = node('div'); host.append(target);
  const message = status(host); let disposed = false;
  const board = createKanban(target, {
    Columns: columns, Cards: cards, AllowEditing: true, AllowReorder: true,
    EnableBulkSave: true, ShowSearch: true,
  }, {
    DirtyChanged: count => { message.textContent = count ? `${count} cards changed. Not saved yet.` : 'No unsaved changes.'; },
    SaveRequested: async (requestId, submitted, changes) => {
      message.textContent = 'Saving the complete batch…';
      try {
        // The server validates versions, permissions and the entire transaction.
        const canonical = await save(requestId, submitted, changes);
        if (disposed) return;
        board.update({ SaveResultRequestId: requestId, SaveResultSuccess: true,
          SaveResultMessage: 'Changes saved.', SaveResultCards: canonical });
        message.textContent = 'Saved. This response is now the accepted baseline.';
      } catch {
        if (disposed) return;
        board.update({ SaveResultRequestId: requestId, SaveResultSuccess: false,
          SaveResultMessage: 'Could not save. Your draft is still available; retry or discard.' });
        message.textContent = 'Save rejected. The draft is still available.';
      }
    },
  });
  return { destroy() { disposed = true; board.destroy(); host.replaceChildren(); } };
}

OutSystems implementation

Use BluKavantUi_Pro_Data → Kanban and its public BluKanbanColumn/BluKanbanCard structures. This recipe uses the Pro editing and bulk-save contract.

Binding / handlerImplementation
InputsBind Columns and Cards lists; set AllowEditing=True and EnableBulkSave=True.
OnCardsChangedDeserialize CardsJson as BluKanbanCard List and assign it to the local list bound to Cards. Do not write to the database here.
OnSaveRequestedMap RequestId, CardsJson and ChangesJson to one Client Action. Call a Server Action that validates and commits the batch.
Success AssignSaveResultRequestId=RequestId; SaveResultSuccess=True; SaveResultMessage="Changes saved."; SaveResultCardsJson=the complete saved list.
Failure AssignSaveResultRequestId=RequestId; SaveResultSuccess=False; SaveResultMessage=a useful safe reason; SaveResultCardsJson="". Handle exceptions through this same path.
Intentional reloadOnly after an explicit discard decision, assign new Cards and change ResetKey together. Do not use ResetKey for routine input updates.

Add these native Blocks to your consumer Screen, bind the listed events and connect your application actions. The interactive example above runs the web implementation.

Open the full native Kanban API →
AVOID THESE FAILURES

What breaks this workflow

Acknowledging before commit

A request being sent is not success. Wait for the database transaction.

Returning only changed cards

SaveResultCards replaces the complete baseline. Return every card or omit it to accept exactly the submitted list.

Retrying an unknown commit

Use request IDs or an idempotency policy on the service so a lost response does not create duplicate records.

BEFORE YOU SHIP

Verify the behavior, including recovery.

  • Reject a save and verify field edits and ordering remain available.
  • Retry, then edit again: the new baseline is the last accepted response.
  • An outdated record version produces a conflict, not a silent overwrite.
  • A failed save unlocks editing; keyboard users can reach retry and discard.

Use the linked component accessibility notes when reviewing focus, keyboard behavior and status announcements in your implementation.

All patterns →

Search BluKavantUI