1

I am trying to develop my first multi-pages mobile application using IBM Worklight and Dojo.
I've also followed this tutorial: I have followed this tutorial https://www.youtube.com/watch?v=5GFX-7AS3Kw

This is my HTML:

<!DOCTYPE HTML>
<html>
        <head>
            <meta charset="UTF-8">
            <title>MyApp</title>
<meta name="viewport"
    content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<!--
                <link rel="shortcut icon" href="images/favicon.png">
                <link rel="apple-touch-icon" href="images/apple-touch-icon.png"> 
            -->
            <link rel="stylesheet" href="css/main.css">
            <script>window.$ = window.jQuery = WLJQ;</script>
            <script type="text/javascript" src="dojox/mobile/deviceTheme.js"></script>
            <script type="text/javascript" data-dojo-config="isDebug: false, async: true, parseOnLoad: true, mblHideAddressBar: false" src="dojo/dojo.js"></script>
        </head>
        <body style="display: none;">
    <div data-dojo-type="dojox.mobile.View" id="home"
        data-dojo-props="selected:true"></div>
    <ul data-dojo-type="dojox.mobile.TabBar" fixed="bottom">
        <li data-dojo-type="dojox.mobile.TabBarButton" data-dojo-props="transition:'slide',dir:'1',moveTo:view0">First Page</li><li
            data-dojo-type="dojox.mobile.TabBarButton" data-dojo-props="moveTo:view1,transition:'fade'">Second page</li>
    </ul>
        <div data-dojo-type="dojox.mobile.View" class="myclass" id="view0"
            data-dojo-props="selected:false">random text</div>
        <div data-dojo-type="dojox.mobile.View"  class="myclass" id="view1"
            data-dojo-props="selected:false">here the same</div>

    <script src="js/initOptions.js"></script>
            <script src="js/main.js"></script>
            <script src="js/messages.js"></script>
        </body>
</html>    

However, when I run it in the Emulator, I get the following error:

uncaught exception uncaught type error object # has no method match

What's wrong?

Idan Adar
  • 44,156
  • 13
  • 50
  • 89
Mary Defal
  • 27
  • 1
  • 5

1 Answers1

0

The error is not clear. A fuller log from LogCat would be much better.

Until you provide it... and based on this question: IBM Worklight 6.1 - Unable to have a working Dojo view transition

Try changing the following:

<li data-dojo-type="dojox.mobile.TabBarButton" data-dojo-props="transition:'slide',dir:'1',moveTo:view0">First Page</li>
<li data-dojo-type="dojox.mobile.TabBarButton" data-dojo-props="moveTo:view1,transition:'fade'">Second page</li>

To this:

<li data-dojo-type="dojox.mobile.TabBarButton" data-dojo-props="transition:'slide',dir:'1',moveTo:'view0'">First Page</li>
<li data-dojo-type="dojox.mobile.TabBarButton" data-dojo-props="moveTo:'view1',transition:'fade'">Second page</li>

Note the addition of single-quotes for the moveTo value.

Community
  • 1
  • 1
Idan Adar
  • 44,156
  • 13
  • 50
  • 89