Forum

Armin Winkler
      Has successfully completed the online course Introduction
      Has successfully completed the online course Intermediate (200)
      Has successfully completed the online course Advanced (300)
      Has successfully completed the online course Basics (100)
    4 years ago #24422
    Up
    1
    Down
    ::

    Hi Patrick,

     

    yes you’re right, OpenUI5’s ID scheme is always built up like this in the DOM: “ScreenId–WidgetId”. Therefore, if you’re using the byId function from the core element of OpenUI5 as in the above example, you have to prefix the id of the current screen you’re on inside of your application and then use two minuses as a separator from the widget id as well. However, there are more ways to access a certain screen element which don’t require you to prefix the screen id anymore:

    – From the screen object: sap.ui.getCore().byId(“ScreenId”).by(“WidgetId”)

    – Using “this” (important note: usually the “this” object that you can access from a script within the Process Designer of Simplifier will return the current screen’s controller; please keep in mind though that “this” might be something different depending on the scope during runtime, e.g. inside of a callback function): this.byId(“WidgetId”) or alternatively this.getView().byId(“WidgetId”)

     

    Hope this helps you to be a bit more flexible in accessing screen elements via script.

     

    Regards,

    Armin