1

I'm setting the icon as an attribute of answers that belong to a question with type 5, and I can't visualize these icons in my movelet.

        <question key="SCOOTER_DETAILS" type="5">
            <answer attributeType="9" key="SCOOTER_DETAILS_TITLE" nextQuestionKey="END" position="0">
                <text>%SCOOTER_DETAILS_TITLE%</text>
            </answer>
            <answer icon="44" attributeType="-128" key="SCOOTER_DETAILS_IMEI" nextQuestionKey="END" position="1">
                <text>%SCOOTER_DETAILS_IMEI%</text>
                <predefinedValue/>
            </answer>
            <answer icon="39" attributeType="-128" key="SCOOTER_DETAILS_SOC" nextQuestionKey="END" position="2">
                <text>%SCOOTER_DETAILS_SOC%</text>
                <predefinedValue/>
            </answer>
            <answer icon="2" attributeType="-128" key="SCOOTER_DETAILS_BATTEMP" nextQuestionKey="END" position="3">
                <text>%SCOOTER_DETAILS_BATTEMP%</text>
                <predefinedValue/>
            </answer>
            <answer icon="3" attributeType="-128" key="SCOOTER_DETAILS_ODOMETER" nextQuestionKey="END" position="4">
                <text>%SCOOTER_DETAILS_ODOMETER%</text>
                <predefinedValue/>
            </answer>
            <answer icon="8" attributeType="-128" key="SCOOTER_DETAILS_LAST_CHARGED" nextQuestionKey="END" position="5">
                <text>%SCOOTER_DETAILS_LAST_CHARGED%</text>
                <predefinedValue/>
            </answer>
            <answer icon="12" attributeType="-128" key="SCOOTER_DETAILS_CURRENT_LOCATION" nextQuestionKey="END" position="6">
                <text>%SCOOTER_DETAILS_CURRENT_LOCATION%</text>
                <predefinedValue/>
            </answer>
            <answer icon="42" attributeType="-128" key="SCOOTER_DETAILS_DRIVER_NAME" nextQuestionKey="END" position="7">
                <text>%SCOOTER_DETAILS_DRIVER_NAME%</text>
                <predefinedValue/>
            </answer>
        </question>    

This thing is working for question type 6.

I would appreciate if someone could help me find a solution to this problem. Thanks.

Roberto
  • 11
  • 1

1 Answers1

2

While you are able to display icons in a menu screen (type="6"), you aren't allowed to define icons in a text item screen (type="5"), with exception of the attributeType="12" answers. Those are especially designed for displaying a label and an icon. Furthermore you can define the icon dynamically with the setAnswerIconByClientKey($answer:"key", ck, iconID); method.

Just a hint for the layout. You can adjust the ratio of the label and the icon space by the use of the columnSizeType="" attribute. As long as the icon only claims a few pixels in width, you should set it to "RIGHT", to have more space for the label. Possible values are LEFT, RIGHT, EQUAL and ROWS and this setting is also valid for all other attributeTypes.

Best regards, Andreas

Andreas
  • 106
  • 3
  • 1
    Hi Andreas, thanks you for you answer. I tried it, but what I need to display a form with icon beside the label. What I finally did was displaying a table (without headers) setting as first column the icon, and two columns more for label and its value. Best regards, Roberto – Roberto Jul 21 '15 at 14:59
  • Another option, if you could afford, have a set of icons with text on them. If you are displaying some status messages - you could have an icon with some text - corresponding to each of the state. Put them in your master data and modify them as per the state. We faced issues while displaying icons in the table. The icons should be of fixed size and they turned out to be too small for mobile screen. – Praneesh Jun 21 '16 at 11:48