Search code examples
jquerywicketbootstrap-multiselect

Bootstrap MultiSelect - Not showing dropdown in Wicket Modal Window


I have implemented Bootstrap Multiselect which appears in a wicket modal window to choose certain options for a task. I am unable to open dropdown window to choose options on click of it. Strange thing is I am able to open it in the parent window of this modal window where another similar multiselect is available..

Here is the code of a JS function for generating my multiselect box -

var inputField = jQuery('#' + input);
    try
    {
        inputField
                .multiselect({
                    maxHeight : 400,
                    includeSelectAllOption : false,
                    enableFiltering : false,
                    buttonWidth : '100%',
                    dropRight : true
                });
    } catch (ex)
    {}

I see that appropriate bootstrap and bootstrap multiselect versions are available with this page. Unable to figure out the issue.

enter image description here


Solution

  • I have applied a hack to fix this issue as nothing seems to be working in wicket modal window

    jQuery('body').on('click', '[data-toggle=dropdown]', function() {
        var opened = $(this).parent().hasClass("open");
        if (! opened) {
            $('.btn-group').addClass('open');
            $("button.multiselect").attr('aria-expanded', 'true');
        } else {
            $('.btn-group').removeClass('open');
            $("button.multiselect").attr('aria-expanded', 'false');
        }
    });
    

    Bit of additional code to add, but It solved my issue.