Topic: Migrating from MDB5 V7 to V9

soiware priority asked 7 hours ago


Expected behavior

After upgrading from MDB5 v7 to v9, complex HTML pages partially rendered by Delphi IntrawWeb should continue working as before. Select components should: - Retain values passed from the server on initial page load - Properly receive and display values from AJAX calls controlled by IntrawWeb - Initialize correctly when loaded dynamically (not rendered by IntrawWeb) - Display selected option text in the select input field

Actual behavior

After installing MDB5 v9.x, the application shows several issues: 1. Select components do not retain values passed from the server 2. AJAX calls that update select values (controlled by IntrawWeb) are not reflected in the UI 3. Dynamically loaded select components fail to acquire their values 4. Selected options are present in the raw HTML but not displayed in the select input field

Resources (screenshots, code snippets etc.)

This is the initialization function that worked perfectly with MDB5 v7:

const fnInitSelectMDB5 = (parent) => { if (parent == undefined) { parent = ""; } else { parent = parent + " "; } if (!$(".select-dropdown-sm").length) { $("").appendTo("body"); }

    $(parent + " select").not(".noMDB5Init").each(function (i, item) {
            const instance = mdb.Select.getInstance($(item)[0]);
            if (instance) {
                    console.log('Component already initialized');
            } else {
                    console.log('Component NOT yet initialized');

                    // Check if select is inside a modal
                    const isInModal = $(item).closest('.modal').length > 0;

                    const selectOptions = {
                            size: "sm",
                            clearButton: false,
                            visibleOptions: 18,
                            optionHeight: 28,
                            container: isInModal ? 'body' : ".select-dropdown-sm"
                    };

                    // Enable filter only if NOT in a modal
                    if (!isInModal) {
                            selectOptions.filter = true;
                    }

                    new mdb.Select(item, selectOptions);
            }
    });

}

Context:

I understand this is a complex scenario and I haven't provided enough analysis elements yet - I'm still working with Claude Sonnet to help with the diagnosis. The application uses: - Delphi IntrawWeb for server-side rendering - Dynamic AJAX updates controlled by IntrawWeb - Mixed static and dynamic component loading - Custom initialization functions for MDB5 components

Request:

Could you provide insights into substantial changes in select component management between MDB5 v7 and v9 that might help with diagnosis? Specifically: 1. Changes in initialization patterns or timing 2. Modifications to how selected values are handled/displayed 3. New requirements for data attributes or initialization methods 4. Changes in how MDB5 detects and synchronizes with existing HTML selected attributes

Any guidance on significant architectural changes that could affect complex server-rendered applications would be extremely helpful for troubleshooting.



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Opened

Specification of the issue

  • ForumUser: Priority
  • Premium support: Yes
  • Technology: MDB Standard
  • MDB Version: MDB5 9.2.0
  • Device: PC
  • Browser: Edge
  • OS: WIndows 11
  • Provided sample code: No
  • Provided link: No