Movilizer - Menu Item in a Complex UI Navigation not working properly? - mobile

I'm trying to create a Complex UI consisting of a Menu Item screen (type="6") at the top and a Text Input Screen (type="5") below. I want the Menu Item Screen to go to another screen than the Text Item Screen, though I have to put the Text Item Screen in the nextQuestionKey attribute.
I tried it with a restriction in the Menu Item Screen as shown in the code below, but the validator tells me "Branching is not allowed."
I tried moving the restriction to the Text Input Screen. There the validator tells me that "A menu screen in a complex screen which is not at the end must provide a valid, pre-defined forward navigation answer of 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>
I would appreciate if someone could help me find a solution to this problem.

I think the easiest way to achieve this is to change the sequence of screens so the Text Item screen points to the Menu screen. In the Complex UI you can still display the menu on top if you want, so the sequence for the navigation has no impact on that. In the Menu screen you define a default answer to point to question key 18 ... the clickable answer in the menu screen points to question 17.
For the default answer feature see:
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>
This means that initially the complex UI will display an OK button. If the user presses the OK button, the client navigates to question 18. If the user prsses the Scan barcode button, the client navigates to question 17.

Related

ADB2C Custom policy user journey - override the content definition of each orchestration step

I have a custom policy which I am setting up which is based 2 steps in the user journey
Sign in signup unified
Self assert page.
In my RP file, I have specified ContentDefinitions for each 'type' of page so I can override these with my own. From my understanding, as the RP file is the last one point in the hierarchy, it will override always.
What I am finding is that it works for step 1, but step 2 always seems to default to the standard Microsoft page.
e.g. RP file.
<ContentDefinitions>
<!--For step 1-->
<ContentDefinition Id="api.signuporsignin">
<LoadUri>https://MYURL/custom_step1.html</LoadUri>
<RecoveryUri>~/common/default_page_error.html</RecoveryUri>
<DataUri>urn:com:microsoft:aad:b2c:elements:contract:unifiedssp:1.2.0</DataUri>
<Metadata>
<Item Key="DisplayName">Signin</Item>
</Metadata>
</ContentDefinition>
<!--For step 2-->
<ContentDefinition Id="api.selfasserted">
<LoadUri>https://MYURL/custom_step2.html</LoadUri>
<RecoveryUri>~/common/default_page_error.html</RecoveryUri>
<DataUri>urn:com:microsoft:aad:b2c:elements:contract:selfasserted:1.2.0</DataUri>
<Metadata>
<Item Key="DisplayName">Collect information from user page</Item>
</Metadata>
</ContentDefinition>
</ContentDefinitions>
Ive seen on my UserJourney that Step 1 also seems to define a ContentDefinition (a default I guess?) but specifying my own one on each step didn't seem to have any effect either.
<OrchestrationStep Order="1" Type="CombinedSignInAndSignUp" ContentDefinitionReferenceId="api.signuporsignin">
Suggestions appreciated!

Change xtype dynamically according to the bind value in extjs

I am having a UI page which contains a table which shows the information and we are using extjs to ftech and show the values.
My code is below.
The component looks like below:
<item name="value1" xtype="link" bind="{value}">
<position>22</position>
<default>1</default>
<displayable>1</displayable>
<enabled>1</enabled>
<exportable>1</exportable>
<alwaysAvailable>1</alwaysAvailable>
<editors>
<editor name="filter" xtype="textfield"/>
</editors>
<events>
<event name="click" jsFunction="onClickOpenScreen">
<config>{"url":"......}}</config>
</event>
</events>
<config>{"width": 100}</config>
</item>
and the model is :
<field name="value" tableAlias="table1" column="value" datatype="string">
<required>0</required>
<formula>if some value then value else 0</formula>
</field>
Here in the formula we are fetching the value from db, if value is there then value otherwise display 0.
So my requirement is if any value is there then that will come as hyperlink otherwise it will come as simple value. But from this code even 0 is coming as link.

How to branch a menu that is in a complex grid UI

We are trying to create a large menu in movilizer to support all our options, while doing so we are using a grid complex UI to support larger devices.
Because we use the complex grid UI we currently have 3 menu's and 2 text fields in our complex grid. However we cannot use the menu to branch to different movelets that are called after pressing the buttons in those menu's.
<question key="Q003" type="6">
<answer attributeType="14"
key="A003_1"
nextQuestionKey="Q407"
<text>menu1button</text>
</answer>
<answer attributeType="72"
key="A003_5"
nextQuestionKey="Q004">
<predefinedValue>X</predefinedValue>
</answer>
<complex linearGroupId="Information" gridGroupId="gridMenu" gridHorizontalLayout="false" linearPos="1" gridPosX="0" gridPosY="1" groupTitle="menuGrid"/>
</question>
<question key="Q004" type="6">
<answer attributeType="14"
key="A004_1"
nextQuestionKey="Q408"
<text>menu2button</text>
</answer>
<answer attributeType="72"
key="A004_3"
nextQuestionKey="Q005">
<predefinedValue>X</predefinedValue>
</answer>
<complex linearGroupId="Information" gridGroupId="gridMenu" gridHorizontalLayout="false" linearPos="2" gridPosX="1" gridPosY="1" groupTitle="menuGrid"/>
</question>
This example excerpt from our code will throw an error saying branching is not allowed for question Q003, however we need these seperate menu's.
Is there any way to circumvent this problem without having to create different movelets for each menu?
Thanks in advance!
you can only achieve this using MEL scripts.
Basic idea is:
you save the selection for all menus that are in the complex UI via MEL scripts
all answers in the first Q in the complex UI link to the second question in the complex UI
all answers in the second Q in the complex UI link to the third question of the complex UI ... and so on
The last question of the complex UI links to an epsilon screen
The epsilon screen uses restrictions that check the selection of the different menus to branch the flow accordingly
This can then look something like this (simplified), Q003:
<question key="Q003" type="6">
<answer key="A003_1"
nextQuestionKey="Q004">
<text>menu1button</text>
</answer>
<answer attributeType="72"
key="A003_DEFAULT"
nextQuestionKey="Q004">
<predefinedValue>X</predefinedValue>
</answer>
<onEnterAssignment>
$local:selections = null;
</onEnterAssignment>
<onLeaveOkPersistAssignment>
$local:selections["Q003"] = getQuestionKey();
</onLeaveOkPersistAssignment>
<complex linearGroupId="Information" gridGroupId="gridMenu" gridHorizontalLayout="false" linearPos="1" gridPosX="0" gridPosY="1" groupTitle="menuGrid"/>
</question>
Q004:
<question key="Q004" type="6">
<answer key="A004_1"
nextQuestionKey="QEPS">
<text>menu2button</text>
</answer>
<answer attributeType="72"
key="A004_DEFAULT"
nextQuestionKey="QEPS">
<predefinedValue>X</predefinedValue>
</answer>
<onLeaveOkPersistAssignment>
$local:selections["Q004"] = getQuestionKey();
</onLeaveOkPersistAssignment>
<complex linearGroupId="Information" gridGroupId="gridMenu" gridHorizontalLayout="false" linearPos="2" gridPosX="1" gridPosY="1" groupTitle="menuGrid"/>
</question>
And QEPS (which does the branching, very simplified):
<question key="QEPS" type="41">
<answer key="AEPS_1"
nextQuestionKey="END"/>
<restriction position="0" nextQuestionKey="Q003">
<condition>$local:selections["Q003"] != $answer:"A003_DEFAULT" ?OR $local:selections["Q004"] != $answer:"A004_DEFAULT"</condition>
</restriction>
</question>

vXML if statement (DTFM only)

I have a simple yes or no question being asked in vXML 2.0. I am trying to get the user to be able to press 1 for yes, or two for 2 for no. I have looked up dozens of answers to this question, however, they all mentioned voice input only and not dtfm. I'm sure it is an obvious answer, but I am at a loss.
Here is my code
<form>
<field name="verifyinput" type="digits?minlength=1;maxlength=1">
<prompt> You entered <?php echo $_SESSION["accountnumber"]; ?>. . If that is your Account Number Press 1. Otherwise Press 2.
</prompt>
<filled>
</filled>
</field>
</form>
I am not sure what to put in the Filled tab.
For simple recognition results, you can just check the value of the field name:
<form>
<field name="verifyinput" type="digits?minlength=1;maxlength=1">
<prompt> You entered <?php echo $_SESSION["accountnumber"]; ?>. . If that is your Account Number Press 1. Otherwise Press 2.
</prompt>
<filled>
<if cond="verifyinput == '1'">
<!-- executable content -->
<prompt>You said one</prompt>
<elseif cond="verifyinput == '2'"/>
<!-- executable content -->
<prompt>You said two</prompt>
<else/>
<!-- executable content -->
<prompt>You made an invalid choice</prompt>
</if>
</filled>

Submit data-table in JSF / Primefaces?

I am working on a web application using jsf/ primefaces, netbeans and tomcat.
I have a datatable with some values loaded in from another table and some editable fields. My question is, after the user has edited this table how do i submit the whole table so it can be stored in a database, in a new table?
<h:form id="form" prependId="false">
<h3>All of your Paddocks</h3>
<p:dataTable var="paddock" value="#{paddock.getfromPaddock()}" editable="true">
<p:ajax event="rowEdit" listener="#{paddock.onRowEdit}" />
<p:ajax event="rowEditCancel" listener="#{paddock.onRowCancel}" />
<p:column headerText="Id">
<h:outputText value="#{paddock.idPaddock}" />
</p:column>
<p:column headerText="Name">
<h:outputText value="#{paddock.name}" />
</p:column>
<p:column headerText="Area">
<h:outputText value="#{paddock.area}" />
</p:column>
<p:column headerText="Enter Grass Weight">
<p:cellEditor>
<f:facet name="output"><h:outputText value="0" /></f:facet>
<f:facet name="input"><p:inputText id="modelInput" value="0" style="width:100%"/></f:facet>
</p:cellEditor>
</p:column>
<p:column style="width:32px">
<p:rowEditor />
</p:column>
</p:dataTable>
<h:commandButton value="Log" action="#{paddock.add}" />
</h:form>
Note that the only editable column is the grass column.
First of all, there are two main mistakes which may have undesired side effects:
<h:form ... prependId="false">
Never use prependId. Remove the whole attribute.
<p:dataTable var="paddock" value="#{paddock.getfromPaddock()}">
You should give var a different name than the managed bean. E.g. paddockItem.
As to the concrete question, your other mistake is here:
<p:inputText id="modelInput" value="0" />
You didn't bind the input value to the model. So JSF won't be able to update the model with the submitted values anyway.
Fix it accordingly, e.g.:
<p:inputText id="modelInput" value="#{paddockItem.grass}" />
In the submit method, it'll be right away there in the model.
You should only make absolutely sure that you aren't interacting with the database in the getter method of the <p:dataTable value>, otherwise you will be overwriting the model on every iteration round, hereby basically trashing the submitted values until the last row before the submit method is hit. The strange method name behind the data table value value="#{paddock.getfromPaddock()}" namely suggests that you're doing that. If it were a real property, the average starter would just have used value="#{paddock.fromPaddock}" or so.
See also:
How and when should I load the model from database for h:dataTable

Resources