Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Help: load document extension in workbench asp.net page

Hello,

I'm trying to load a document extension into a workbench aspx page.  I've tried countless ways to make this work but my javascript skills are non-existent at best.

I have a document extension, and it works perfectly when accessing an ajax version of the QlikView document.  But the extension doesn't fire on the workbench page if the document is not loaded, hence my problem.

When I attempt to migrate the code from the doc extension to the aspx page in the javascript code I get errors.

Here is the javascript code I'm trying to apply:

function getCookie(c_name)

{

var i,x,y,ARRcookies=document.cookie.split(";");

for (i=0;i<ARRcookies.length;i++)

{

x=ARRcookies.substr(0,ARRcookies.indexOf("="));

y=ARRcookies.substr(ARRcookies.indexOf("=")+1);

                 x=x.replace(/^\s+|\s+$/g,"");

                      if (x==c_name)

                                            {

                                                      return unescape(y);

                                            }

                                }

                    }

QvInit = function () {

               var myDoc = Qv.GetCurrentDocument();

               var myLocale = getCookie("QVLocale");

               myDoc.SetVariable("vLocale",myLocale);

}

function loadQVInit(

{

     QvInit();

}

And here is an example of my aspx page:

<body onload="loadQVInit()" oncontextmenu="return false;">

    <form id="form1" runat="server">

        <div>

        </div>

    <table>

        <tr>

            <td width="294px">

            </td>

            <td width="55px">

                <qww:QvObject ID="QvObject1" runat="server" Height="20px" ObjectID="BU_RA_BACK"

                    ObjectType="Button" QlikViewDocument="DocName" Width="50px" />

            </td>

</table>

</form>

</body>

Any and all help is greatly appreciated.

1 Solution

Accepted Solutions
Not applicable
Author

Figured it out.

Even in the Ajax page, there needs to be a javascript reference to qvajax.js below the head section of the html.

<script type="text/javascript" src="/QvAjaxZfc/htc/QvAjax.js"></script>

adding this made it work.

jg

View solution in original post

1 Reply
Not applicable
Author

Figured it out.

Even in the Ajax page, there needs to be a javascript reference to qvajax.js below the head section of the html.

<script type="text/javascript" src="/QvAjaxZfc/htc/QvAjax.js"></script>

adding this made it work.

jg