在worklight混合应用程序中找不到dojox / calendar / Calendar.js 404

时间:2013-08-23 16:35:59

标签: ibm-mobilefirst dojo

我有一个应用程序试图在使用dojo的Worklight 5.0.6混合应用程序中使用dojox.calendar.Calendar。我已将calendar-layer.js.compressed.js添加到我的build-dojo.xml文件中,用于复制和dojo.resources.layers。

    <patternset id="dojo.resources.layers">
            <include name="dojo/dojo.js.compressed.js"/>
            <include name="dojo/core-web-layer.js.compressed.js"/>
            <include name="dojo/calendar-layer.js.compressed.js"/>
    </patternset>

    <copy todir="${build.dir}">
        <fileset dir="${dojo.root}">
            <include name="dojo/mobile-compat-layer.js.compressed.js"/>
            <include name="dojo/mobile-ui-layer.js.compressed.js"/>
            <include name="dojo/calendar-layer.js.compressed.js"/>
        </fileset>
        <mapper refid="dojo.resources.mapper"/>
    </copy>

在我的主html文件中,我已经包含了日历图层。

<body id="content" style="display: none">

<script src="js/initOptions.js"></script>
<script src="js/bobCAT.js"></script>
<script src="js/messages.js"></script>
<script src="dojo/calendar-layer.js"></script>

使用丰富的html编辑器,我将Palette中的日历Dojox Widget添加到一个简单的对话框中。

        <div  data-dojo-type="dojox.mobile.SimpleDialog" id="select-week-dialog">
            <div data-dojo-type="dojox.mobile.Heading"
                data-dojo-props="label:'Select Week'"></div>
            <div id="select-week-dialog-calendar" data-dojo-type="dojox.calendar.Calendar"></div>
            <div align=center>
                <button id="select-week-dialog-ok" data-dojo-type="dojox.mobile.Button" style="width:100%;height:40px">OK</button>
                <button id="select-week-dialog-cancel" data-dojo-type="dojox.mobile.Button" style="width:100%;height:40px">Cancel</button>
            </div>
        </div>

当我构建时,然后启动应用程序。我在控制台中看到以下内容。

Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:8090/apps/services/preview/bobCAT/iphone/1.0/default/dojox/calendar/Calendar.js

任何帮助都会受到欢迎。

2 个答案:

答案 0 :(得分:2)

对于那些感兴趣的人,我花了一些时间到另一个晚上深入研究这个并且能够同时获得dojox.mobile.Calendar和dojox.calendar.Calendar。最后,我创建了自己的日历小部件。 dojox.calendar.Calendar是非常严格的,字体被定义为像素级别,并且它不能很好地扩展。 dojox.mobile.Calendar工作得更好,但我正在寻找的UI是将整周选为整体而不是一天。

要使其正常工作,您需要更新build-dojo.xml以确保所需的CSS,html模板和javascript。很多内容都是通过包含的JS查看,然后在chrome中查看控制台消息中缺少的文件。请参阅以下代码段:

    <!-- copy dojox.mobile -->
    <copy todir="${build.dir}">
        <fileset dir="${dojo.root}">
            <include name="dojox/mobile/bookmarkable.js"/>
            <include name="dojox/mobile/deviceTheme.js"/>
            <include name="dojox/mobile/migrationAssist.js"/>
            <include name="dojox/mobile/mobile-all.js"/>
            <include name="dojox/mobile/themes/**"/>
            <include name="dijit/themes/**"/>
            <include name="dojox/calendar/**"/>
            <include name="dojox/html/**"/>     
            <include name="dojo/cldr/**"/>
            <include name="dojox/widget/**"/>
            <include name="dijit/icons/images/**"/>
        </fileset>
    </copy>

答案 1 :(得分:0)

不确定应用程序的用途,但您是否尝试过使用dojox.mobile.Calendar而不是dojox.calendar.Calendar?