How to define an array of integers using expression binding

  • Christian
        2 years ago #30023

        Hi all,

        I would like to use the PlanningCalendar widget from UI5. To make it run, i.e. to avoid an error in the console (“[0, 1]” is of type string, expected int[] for property “nonWorkingDays” of Element sap.m.PlanningCalendarRow#Screen3–PlanningCalendarRow1) I have to define this int[] expression in the widget configuration. Now my question: how to do this? What is wrong in setting “[0, 1]” to the attribute “nonWorkingDays”?

        Thank you!

        Attachments:
        You must be logged in to view attached files.
        Vitali Kurdasov
            Has successfully completed the online course Intermediate (200)
            Has successfully completed the online course Basics (100)
            Has successfully completed the online course Advanced (310)
            Has successfully completed the Intermediate Certification
          2 years ago #30037
          Up
          1
          Down
          ::

          Hi Christian,

          i’m sorry to tell you that you can’t do it this way. The reason it is not working is that nonWorkingDays needs to be an array but you define it as a string with the value “[0,1]”

          I would suggest you to create a global variable of the type array of int (which you can create with a collection and the basetype integer). Afterwards you can set the default value to [0,1] in the json view.

        Viewing 2 posts - 1 through 2 (of 2 total)

        You must be logged in to reply to this topic.