Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Workbench & JS API - QvaPublic.GetSelected()

When using QvaPublic.Data.GetSelected(); only getting one element in the array when I have multiple items selected. See Javascript below, I have a button that calls getSelections().

See screen shot below the javascript, which shows firebug output. The alert below reports length of 1.

This is with V10 SR1 workbench and server.

I believe .GetSelected(); should be returning an array of 3 elements. Or am I misunderstanding how .GetSelected(); should work. Not very good documentation....

Thanks, Jim

<script type="text/javascript">

    var qvMonthObject;

    var qvMonthSelections;

    function getSelections() {

        try {

            if (qvMonthObject != null) {

                qvMonthSelections = qvMonthObject.QvaPublic.Data.GetSelected();

                alert("qvMonthSelections[0]=" + qvMonthSelections[0] + " length=" + qvMonthSelections.length);

            }

            else {

                alert('qvMonthObject is NULL');

            }

        }

        catch (e) {

            alert(e);

        }

    }

    nmQvInit = function () {

        qvMonthObject = qva.GetQvObject("pmMonthFilter", function () { });

    }

    Qva.BodyOnLoadFunctionNames.push('nmQvInit');

</script>

qvissue02.jpg

0 Replies