Skip to Content
0

UI5 How to Detect the user moving away from View

Apr 03, 2017 at 03:02 PM

62

avatar image

Is there a specific UI5 related event or method to detect when the user moves away from a View, or changes view focus?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Jun Wu Apr 03, 2017 at 06:34 PM
0

what's your point?

Show 2 Share
10 |10000 characters needed characters left characters exceeded

I have two Views, with the first view containing a table, of which when a row is selected, navigation is done to move to the second view.

The second view can be bound to the global model using the XML, like so:<Table items="{GM>/Contact/Insurance}" ...

However, when inserting, deleting and editing the table, all the functionality of this is handled via functions within the View controller. Therefore, I believe I need to retrieve the data from the global model in the controller, Therefore create another model from this and bind it to the view table, and have the XML binding show <Table items="{/}"...

Is that correct?

If so, once I move away from this view, how do I put the data back in the global model, if I can't detect moving away from the view?.

0

not able to follow u 100%, but i think no need.

0
Mahesh kumar palavalli Apr 03, 2017 at 07:51 PM
0

not sure about the view, but you can check by adding a browser event(method available for all ui5 controls to add a browser event).

the event will be mouseleave:

https://developer.mozilla.org/en/docs/Web/Events/mouseleave

maybe be try adding it for the sap.m.page..

Best Regards,
Mahesh

Share
10 |10000 characters needed characters left characters exceeded