• Bug in XSP.moveToMPage for IE

    By Tommy Valand 1 decade ago

    We're currently developing a mobile webapp for a customer. The customer has Windows Mobile 8 phone.

    I don't have this kind of device to test on, but I tested in IE10, and the same bug occured there.

    Here's a patched version. Tested in IE10, latest version of Chrome, Firefox, and Opera. Also tested on Android native browser.

    XSP.moveToMPage = function sxy_rxy(view, moveTo, dir, transition, params) {
    // dojox.mobile._params = [];
    if (view == null){
    return;
    }

    var paramString = "";
    //check to see that if we have an object that it is a vanilla object
    if (params == null) {//nothing passed in for this arg
    params = "";
    }

    if( params.constructor === String ) {
    if (params.length > 0 && params[0] != "&"){//if we have a string make sure it starts right
    params = "&" + params;
    }
    }

    if (params instanceof Object && params.constructor === Object) {
    for (var k in params){
    paramString += "&" + k + "=" + params[k];
    }
    params = paramString;
    }

    if (params === "" || !params.match(/^(&(\w+)=(\w+))+/)){
    return;
    }

    view.performTransition(moveTo + params, dir, transition);
    };

    • Sample app?

      By Paul Hannan 1 decade ago

      Hi Tommy,

      Do you have a sample app that demonstrates the issue?

      Is it as simple as using the moveTo action in a XPages mobile app on a windows phone?

      Regards,

      Paul.

       

       

      • Yes

        By Tommy Valand 1 decade ago

        What didn't work was a xp:button with moveTo in IE10/IE10 Mobile. Not sure if it matters, but the event was set to full refresh.

        When the page reloaded after the refresh, a call to XSP.moveToMPage was generated inside a dojo.addOnLoad from the framework. I stepped throug this script in the debugger in IE.

        The string test in XSP.moveToMPage fails due to conversion of the constructor object to string being different in IE than in some other browsers. IE 10 returns a string with an initial line break. The test requires the code for the constructor to start without white space.

        I suggest dropping the string conversion and testing directly towards the native objects. It's more efficient and works across all browsers in my experience.

        When I added the "patch script" to the page, everything worked across the browsers I had access to.

        • Bug logged with the core,and maybe a workaround

          By Paul Hannan 1 decade ago

          Thanks Tommy.

          I've logged a bug against the core on this - PHAN9C4EFZ

          In the meantime, would using a xe:toolBarButton control workaround this case...

                          moveTo="PAGE2" transition="fade">
           

          ...?

          • Not sure

            By Tommy Valand 1 decade ago

            I put the app into production today with the patch from my first post, so I'm happy and the customer is happy :)

            When the bug is fixed, I will (hopefully remember to!!) remove the patch from the app so that it's compatible with future versions of the Extension Library.

            Thanks for logging the bug!