Movilizer - 复杂UI中的菜单项导航无法正常工作?

时间:2015-03-25 14:22:54

标签: mobile movilizer

我正在尝试创建一个复杂的UI,它由顶部的菜单项屏幕(type =“6”)和下面的文本输入屏幕(type =“5”)组成。我希望菜单项屏幕转到除文本项屏幕之外的另一个屏幕,但我必须将文本项屏幕放在nextQuestionKey属性中。

我在菜单项屏幕中尝试了它,如下面的代码所示,但验证器告诉我“不允许分支。”

我尝试将限制移到文本输入屏幕。验证器告诉我“复杂屏幕中的菜单屏幕不在最后,必须提供attributeType = 72的有效预定义前向导航答案”

<question key="15" type="6" backNavigationAllowed="true" sortAnswersByClientKey="false">
    <answer key="15_1" nextQuestionKey="16" clientKey="CK#15">
        <text>Scan barcode</text>
    </answer>
    <restriction nextQuestionKey="17" position="0">
        <condition>getAnswerValueByClientKey($answer:"15_1", "CK#15") != ""</condition>
    </restriction>
    <complex linearGroupId="InputAssetNumber" gridGroupId="InputAssetNumber" linearInnerScrollbar="false" gridInnerScrollbar="false" gridHorizontalLayout="false" linearPos="0" gridPosX="0" gridPosY="0" gridWidth="1" gridHeight="1" linearHeight="1" groupTitle="Input Asset number"/>
</question>

<question key="16" type="5" backNavigationAllowed="true" sortAnswersByClientKey="false">
    <answer key="16_1" nextQuestionKey="18" clientKey="CK#16" columnSizeType="ROWS">
        <text>Enter barcode manually</text>
    </answer>
    <answer key="16_2" nextQuestionKey="18" clientKey="CK#16" columnSizeType="ROWS">
        <text>Reason</text>
    </answer>
    <complex linearGroupId="InputAssetNumber" gridGroupId="InputAssetNumber" linearInnerScrollbar="false" gridInnerScrollbar="false" gridHorizontalLayout="false" linearPos="1" gridPosX="0" gridPosY="1" gridWidth="1" gridHeight="1" linearHeight="1"/>
</question>

如果有人能帮我找到解决这个问题的方法,我将不胜感激。

1 个答案:

答案 0 :(得分:3)

我认为实现此目的的最简单方法是更改​​屏幕顺序,以便“文本项目”屏幕指向“菜单”屏幕。在复杂UI中,如果需要,您仍然可以在顶部显示菜单,因此导航序列对此没有影响。在菜单屏幕中,您可以定义一个默认答案,指向问题键18 ...菜单屏幕中的可点击答案指向问题17.

有关默认答案功能,请参阅:  https://devtools.movilizer.com/confluence/display/DOC22/Default+Answer+feature+for+Image+Menu+screens

<question key="15" type="5" backNavigationAllowed="true" sortAnswersByClientKey="false">
  <answer key="15_1" nextQuestionKey="16" clientKey="CK#16" columnSizeType="ROWS">
    <text>Enter barcode manually</text>
  </answer>
  <answer key="15_2" nextQuestionKey="16" clientKey="CK#16" columnSizeType="ROWS">
    <text>Reason</text>
  </answer>
  <complex linearGroupId="InputAssetNumber" gridGroupId="InputAssetNumber" linearInnerScrollbar="false" gridInnerScrollbar="false" gridHorizontalLayout="false" linearPos="1" gridPosX="0" gridPosY="1" gridWidth="1" gridHeight="1" linearHeight="1"/>
</question>

<question key="16" type="6" backNavigationAllowed="true" sortAnswersByClientKey="false">
  <answer key="16_1" nextQuestionKey="17" clientKey="CK#17">
    <text>Scan barcode</text>
  </answer>
  <answer key="16_2" nextQuestionKey="18" clientKey="CK#18" attributeType="72">
    <text>default answer</text>
    <predefinedValue>X</predefinedValue>
  </answer>
  <complex linearGroupId="InputAssetNumber" gridGroupId="InputAssetNumber" linearInnerScrollbar="false" gridInnerScrollbar="false" gridHorizontalLayout="false" linearPos="0" gridPosX="0" gridPosY="0" gridWidth="1" gridHeight="1" linearHeight="1" groupTitle="Input Asset number"/>
</question>

这意味着最初复杂的UI将显示一个OK按钮。如果用户按下确定按钮,则客户端导航到问题18.如果用户扫描扫描条形码按钮,则客户端导航到问题17.