Skip to Content
author's profile photo Former Member
Former Member

Running a custom method on a controls rendering from a XML view level in SAPUI5

I would like to implement some kind of ACL in a SAPUI5 XML view.

onBeforeRendering="customFunc"     />

Is there a way to launch the "customFunc" on some kind of "render"/"before render" event of the control? The "customFunc" is defined in a base controller (currently parent to the one that initializes the view and therefore - the control (in this case, a Button, but not always)).

The "customFunc" as mentioned above, is gonna have to be called in various controls. So is there a global method/event like the mentioned above "onBeforeRendering"?

Is this the best way of handling some globally available, custom methods (via the base controller)?

Add comment
10|10000 characters needed characters exceeded

  • Former Member Dheeram Kallem

    Hi Dheeram,

    The main problem is that I do not wan't to involve controllers into this, but simply call custom model methods (with attributes) from the XML view. The model has some globally available methods. Let's call the model simply MyModel. Then you call a method simply by going MyModel.MyCustomMethod(id-of-element-to-hide).

    Assuming that the method returns a certain value, could I go with something like this?

    enabled="MyModel.MyCustomMethod(some-id)"     />
  • Then use a formatter. In the formatter method you can write your own logic.

  • what are you talking?

0 Answers