工作灯& Dojo多页错误

时间:2014-06-24 11:49:19

标签: android ibm-mobilefirst dojo

我正在尝试使用IBM Worklight和Dojo开发我的第一个多页面移动应用程序 我也遵循了本教程:我已经按照本教程https://www.youtube.com/watch?v=5GFX-7AS3Kw

进行了操作

这是我的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>    

但是,当我在模拟器中运行它时,我收到以下错误:

  

未捕获的异常未捕获类型错误对象#没有   方法匹配

出了什么问题?

1 个答案:

答案 0 :(得分:0)

错误不明确。来自LogCat的更全面的日志会好得多。

直到您提供...并基于此问题:IBM Worklight 6.1 - Unable to have a working Dojo view transition

尝试更改以下内容:

<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>

对此:

<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>

请注意为moveTo值添加单引号。