Back to KB
Difficulty
Intermediate
Read Time
10 min

🖼️ Picking Data from Iframe Popups in Joget

By Codcompass Team··10 min read

Cross-Window Data Injection: Building Bulk Selectors in Joget with Iframe Popups

Current Situation Analysis

Enterprise applications built on low-code platforms like Joget frequently encounter a structural limitation: native form components excel at single-record CRUD operations but struggle with bulk data selection. Standard dropdowns, autocomplete fields, and basic multi-select widgets force users to scroll through static lists, apply limited filters, and manually map values. When business logic requires scanning a master dataset, applying complex filters, and injecting multiple records into a form grid, the native UI becomes a bottleneck.

This gap is often misunderstood as a platform constraint rather than a window-communication architecture problem. Developers typically attempt to rebuild search and filtering logic inside modal dialogs or custom plugins, duplicating effort that already exists in Joget's list views. The reality is that Joget exposes list views as fully functional, filterable interfaces via embeddable URLs. The missing piece is a reliable bridge between that embedded interface and the parent form's data model.

Production metrics consistently show that bulk selection workflows reduce data entry time by 40–60% compared to sequential single-row inputs. However, without proper validation, bulk injection introduces duplicate records, schema mismatches, and UI state desynchronization. The solution requires precise cross-window DOM traversal, real-time duplicate checking against the parent form's current state, and programmatic invocation of Joget's internal grid mutation APIs. When implemented correctly, this pattern transforms static forms into dynamic, enterprise-grade data entry interfaces.

WOW Moment: Key Findings

The architectural shift from native pickers to iframe-based popup bridges fundamentally changes how users interact with master data. The following comparison highlights the operational impact:

ApproachSelection SpeedDuplicate PreventionImplementation ComplexityUX Friction
Native Joget DropdownLow (single item)Manual/NoneMinimalHigh (scroll/search limits)
Standard Multi-Select WidgetMediumClient-side onlyModerateMedium (static data)
Iframe Popup BridgeHigh (bulk filter & pick)Real-time array validationAdvancedLow (familiar list UI)

This finding matters because it decouples data discovery from data entry. Users leverage Joget's existing list views—complete with pagination, sorting, and column filtering—without requiring custom plugin development. The bridge pattern enables a "shopping cart" workflow where records are reviewed, validated, and injected in a single transaction. This reduces cognitive load, eliminates redundant UI development, and maintains strict data integrity through parent-side validation before mutation.

Core Solution

The architecture relies on a controlled parent-child window relationship. A trigger element in the parent form opens a popup, injects an <iframe> pointing to a Joget list view, and establishes a communication channel. When the user confirms selection, the popup script extracts checked rows, validates them against the parent form's existing grid data, and invokes Joget's dynamic row-addition function.

Architecture Decisions & Rationale

  1. Popup vs. Modal: A native window.open() popup is preferred over an in-page modal because it isolates the iframe's DOM, prevents CSS leakage, and avoids Joget's form validation lifecycle interference.
  2. Embed Parameter: Appending ?embed=true to the Joget list URL strips navigation chrome, reduces payload size, and focuses the UI on data selection.
  3. DOM Scraping over REST: While Joget provides REST APIs, list views maintain UI state (checkboxes, filters, pagination) that is not fully exposed via endpoints. Scraping the iframe's DOM captures the exact user-selected state without additional API calls.
  4. Dynamic _add Invocation: Joget generates a row-addition function per grid field using the naming convention [fieldId]_add. Calling this function directly ensures proper form state management, validation triggers, and UI rendering.

Implementation Code

The following implementation uses modern JavaScript with explicit type safety, robust error handling, and clean separation of concerns. It is designed to run within Joget's

🎉 Mid-Year Sale — Unlock Full Article

Base plan from just $4.99/mo or $49/yr

Sign in to read the full article and unlock all 635+ tutorials.

Sign In / Register — Start Free Trial

7-day free trial · Cancel anytime · 30-day money-back