问题标签 [worklight-runtime]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
1141 浏览

ibm-mobilefirst - IBM Worklight - 如何添加多语言支持?

如何在 Worklight 应用程序中添加多语言支持?谁能给我一些例子?

0 投票
1 回答
3107 浏览

ibm-mobilefirst - IBM Worklight - 连接/重新连接:WL.Client.connect 与 connectOnStartup 与 WL.Client.invokeProcedure

在我们的项目中,我们试图弄清楚连接到服务器的最佳过程是什么——尤其是在处理离线/在线场景等时。

现在,对我们来说,连接到 WL 服务器的所有三个选项似乎都是相似的。无论我们使用什么选项,我们都可以完美地调用我们的适配器过程,并且我们会收到在控制台中设置的通知消息。我们不确定直接更新 - 这还不能正常工作。

这三种连接到 WL 服务器的方式之间是否有任何重要区别,或者在所有三种情况下执行的连接过程基本相同?

WL.Client.init() 在连接之前怎么样 - 在我们手动使用 WL.Client.connect 连接之前,我们是否可以在我们的代码中再次调用它(除了标准窗口加载 EventListener) - 或者 init() 应该是只调用一次?

与之相关的也是离线并重新连接。据我在教程中阅读,WL 客户端框架正在管理连接状态。这是否意味着当 WL 客户端通过这三种方式中的任何一种连接到服务器并失去其 WLAN/3G/4G 连接(或者由于 Internet 连接阻止程序等原因而无法访问 WL 服务器)时,它会自动重新连接(定期尝试重新连接直到成功)当与 WL 服务器的连接再次可用时?

编辑

我在考虑提供更多低级信息(不是 WORKLIGHT_IS_CONNECTED)的事件或线程 - 基本上是在设备丢失/获取 WIFI/3G/4G 连接和/或互联网连接时触发的事件。还是只有使用 WL.Device.getNetworkInfo() 的轮询可用?

Cordova Event 的使用会像:

提供接近的功能?

0 投票
2 回答
327 浏览

ibm-mobilefirst - IBM Worklight - 如何在更新应用程序之前执行 JavaScript 代码?

当有新的软件更新可用时,如果用户将数据存储在 jsonstore 中,我需要允许用户在应用软件更新之前将它们提交到服务器,这样他/她未提交的更新就不会丢失。目前用户在安装更新之前无法使用该应用程序。

有没有办法在更新应用程序之前执行 JavaScript 代码,以便我可以在执行更新安装之前初始化 jsonstore、获取数据并发送到适配器?

0 投票
1 回答
344 浏览

ibm-mobilefirst - 是否可以在 WL.BusyIndi​​cator 中更新短信?

在开始长时间运行的进程之前,我通过此代码创建了一个新的 WL.BusyIndi​​cator ...

是否可以在该过程中间歇性地更新“文本”参数?我尝试调用此函数,但它不起作用。有任何想法吗?

0 投票
1 回答
815 浏览

android - IBM Worklight 6.0 - 无法更改默认 WL.BusyIndi​​cator 文本

我已经像以下代码一样测试了 WL.BusyIndi​​cator:

信息中心说BusyIndi​​cator 选项可以在 Android 环境中获取“文本”

我可以看到我的 Android 模拟器 (v4.0.4/v4.1.2/v4.2.2) 上显示的 BusyIndi​​cator,但文本是默认的“正在加载”...

注意:同样的情况也发生在 iOS 中。

我的 Worklight Studio 版本是:6.0.0.201307241843

0 投票
3 回答
1183 浏览

ibm-mobilefirst - IBM Worklight 5.0.6.1 - iOS 7 中的底部空白

我的应用

如您所见,我的页面底部仍然是一个空白区域。它的高度与 ios6 中的旧状态栏相同。我必须修改css吗?因为我从未为我的应用程序固定高度,所以 worklight 总是选择合适的尺寸。

编辑:您必须保存图像并在具有不同颜色的桌面中打开才能看到底部的空白。

0 投票
2 回答
1631 浏览

android - IBM Worklight 6.0 - 如何覆盖后退按钮?

我使用 Dojo 1.9 开发了一个 Worklight 应用程序。在我返回前一个视图的应用程序中,我在应用程序的标题中使用了后退按钮。

返回按钮代码

是否可以使用设备的后退按钮导航到上一个视图?以便我可以在我的应用程序中使用这两种方法?

0 投票
1 回答
112 浏览

ibm-mobilefirst - IBM Worklight - 可以从连接失败框中删除“详细信息”按钮吗?

是否有允许您从“错误 - 应用程序连接到服务失败”消息框中删除详细信息选项的设置?

0 投票
1 回答
665 浏览

ibm-mobilefirst - IBM Worklight 5.0.6.1 - onFailure and onSuccess execution at Client.connect() and invokeProcedure() NOT exclusive when timeout?

We are seeing a surprising scenario when we are on a slow network connection and our calls to the WL Server time out.

This happens at WL.Client.connect as well as on invokeProcedure:

  • we execute the call with a timeout of 10 seconds
  • the network connection is slow so the call times out
  • the defined onFailure procedure associated to that call is executed
  • the WL Server responds with a valid response after the timeout
  • the onSuccess procedure associated to that call is executed

Is this the designed and intended behavior of the WL Client Framework? Is this specified in the InfoCenter documentation or somewhere?

All developers in our team expected these two procedures to be exclusive and our code was implemented based on this assumption. We are now investigating options on how to match a timed-out/failed response to a success response to make sure we achieve an exclusive execution of onFailure or onSuccess code/logic in our app.

Note: we did not test that with connectOnStartup=true and since the initOptions does not provide an onSuccess procedure (since WL handles that internally) it might be even harder to implement an exclusive execution in this case.

0 投票
1 回答
653 浏览

ios - IBM Worklight - 如何设置忙碌指示器的样式

我正在尝试弄清楚如何更改BusyIndicator. 请参见下面的代码片段和解释:

此代码段将强制忙碌指示器在调用时占据 iPhone 移动设备的整个窗口。此行为在 Android 设备上有所不同。

以下是我的问题:

  1. 在设备内部,如何将背景颜色从纯黑色更改为另一种颜色或透明?
  2. 我已经覆盖了与BusyIndicator布局相关的 CSS 类......在浏览器中测试时确实有效。但是,当应用程序被推送到设备时,我仍然只看到黑色背景。为什么会这样?