标签在Dojo应用程序中不起作用

时间:2015-04-12 19:51:38

标签: android eclipse dojo ibm-mobilefirst

我正在尝试使用Dojo工具包在eclipse juno上的IBM MobileFirst Platform上的混合应用程序中创建多个页面。

在设计视图中:不显示主页以外的页面中的文字。

在运行和部署所有环境后,我在浏览器上预览(镶边)并且标签不起作用

<!DOCTYPE HTML>
<html>
<head>
        <meta charset="UTF-8">
        <title>MoodApp</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="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="view0" data-dojo-props="selected:false">
    <div data-dojo-type="dojox.mobile.Heading" data-dojo-props="label:'My Mood App'">
    </div>
    <ul data-dojo-type="dojox.mobile.TabBar" fixed="bottom">
        <li data-dojo-type="dojox.mobile.TabBarButton" data-dojo-props="moveTo:loginPage,transition:'slide',icon:'images/done.png'">Log in</li><li
            data-dojo-type="dojox.mobile.TabBarButton" data-dojo-props="moveTo:signupPage,icon:'images/comments16.png',transition:'slide'">Sign up</li>
    </ul>

    <div data-dojo-type="dojox.mobile.View" id="loginPage" data-dojo-props="selected:true">Enter username and password</div>
    <div data-dojo-type="dojox.mobile.View" id="signupPage" data-dojo-props="selected:false">sign up now</div>


</div>




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

1 个答案:

答案 0 :(得分:0)

  1. Eclipse Juno不是IBM MobileFirst Platform中受支持的Eclipse版本 - 升级到Eclipse Java EE Kepler或Luna。

  2. 在设计模式下,您只会看到活动标签,因此根据您的代码,您只会看到视图0.在data-dojo-props="selected的真/假值之间切换以在您的网页之间切换...但更好的是,请参阅下面的更全面的例子。

  3. 您的标签不起作用,因为您没有将moveTo值放在单引号中:

    <ul data-dojo-type="dojox.mobile.TabBar">
        <li data-dojo-type="dojox.mobile.TabBarButton" data-dojo-props="moveTo:'loginPage',transition:'slide',icon:'images/done.png'">Login</li>
        <li data-dojo-type="dojox.mobile.TabBarButton" data-dojo-props="moveTo:'signupPage',icon:'images/comments16.png',transition:'slide'">Signup</li>
    </ul>
    
  4. 富勒示例:

    <div data-dojo-type="dojox.mobile.View" id="view0" data-dojo-props="selected:false">
        <div data-dojo-type="dojox.mobile.Heading" data-dojo-props="label:'My Mood App'">
        </div>
    
        <p>
            This is view 0.<br/>
            This is view 0.<br/>
            This is view 0.<br/>
        </p>
    
        <ul data-dojo-type="dojox.mobile.TabBar">
            <li data-dojo-type="dojox.mobile.TabBarButton" data-dojo-props="moveTo:'loginPage',transition:'slide',icon:'images/done.png'">Login</li>
            <li data-dojo-type="dojox.mobile.TabBarButton" data-dojo-props="moveTo:'signupPage',icon:'images/comments16.png',transition:'slide'">Signup</li>
        </ul>
    </div>
    
    <div data-dojo-type="dojox.mobile.View" id="loginPage" data-dojo-props="selected:false">
        <div data-dojo-type="dojox.mobile.Heading" data-dojo-props="label:'My Mood App'">
        </div>
        Enter username and password
    </div>
    
    <div data-dojo-type="dojox.mobile.View" id="signupPage" data-dojo-props="selected:false">
        <div data-dojo-type="dojox.mobile.Heading" data-dojo-props="label:'My Mood App'">
        </div>
    
        sign up now
    </div>