如何在另一个视图中获取元素的引用 id - UI5 [英] How to get the reference id of an element in another view - UI5

查看:43
本文介绍了如何在另一个视图中获取元素的引用 id - UI5的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在另一个视图中获取元素的引用 ID?例如,我有以下文件结构(mvc)

How can I get the reference id of an element in another view? Like for example I have the following file structure (mvc)

-view
|-- View1.view.xml
|-- View2.view.xml
-controller
|-- View1.controller.js
|-- View2.controller.js

假设在View2.controller.js运行时,如何获取View1.view.xml中的某个元素?

Assuming that during runtime of View2.controller.js, how can I get a certain element in View1.view.xml?

推荐答案

您可以使用相对导航.不要使用 absolute 导航,因为如果您从本地 html 更改为 FioriLaunchpad,那将不再起作用.

You can use relative navigation. Do not use absolute Navigation, since that will not work anymore if you change like from local html to a FioriLaunchpad.

您可能想查看的命令:

控制器

管理对象

现在您可以导航到 OwnerComponent,那里将保存您的目标视图,作为变量或元素的聚合.

Now you can navigate to the OwnerComponent, and there will be saved your target View, either as variable or as aggregation of your Element.

这篇关于如何在另一个视图中获取元素的引用 id - UI5的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆