简体   繁体   English

实体对象到不同页面

[英]Entity Object to different pages

I'm using ADF BC and I'm stuck with a problem. 我正在使用ADF BC,但遇到了问题。

I have two diferent pages (tabs) with exactly the same design (same components, different ids) and, if the user fills the components in one page, the other one must have the same content when the user clicks the other tab 我有两个不同的页面(选项卡),它们的设计完全相同(相同的组件,不同的ID),如果用户在一个页面中填充了这些组件,则当用户单击另一个选项卡时,另一个页面的内容必须相同

What's the best way to do this? 最好的方法是什么?

I have 2 main ideas, but I don't know if it's the "right" way to do it: 我有两个主要想法,但我不知道这是否是“正确”的方法:

1 - Use a "config"-ish class to save the information inserted in tab1 and load it tab2 1-使用“ config”类的类来保存插入到tab1中的信息并加载到tab2中

2 - Use two entity objects (one for each tab) and whenever a change is made to the page's content, the entity objects "sync" 2-使用两个实体对象(每个选项卡一个),并且只要更改页面内容,实体对象就会“同步”

Any onther suggestions? 还有其他建议吗? I'm looking for good performance after the screen is loaded so it doesn't matter if the sceen takes a little longer to load (the first time) 萤幕载入后,我一直在寻找良好的效能,因此萤幕载入时间较长(第一次)并不重要

First of all: you will need aim for both best performance and best maintenance. 首先:您将需要同时达到最佳性能和最佳维护的目标。 Therefore you should not duplicate your code. 因此,您不应复制您的代码。

If both tabs will have EXACTLY the same content, a correct ADF design would be: 如果两个选项卡的内容完全相同,则正确的ADF设计应为:

  1. use a single VO and a single EO 使用单个VO和单个EO
  2. create a task flow with fragments and put the CONTENT of the Tab inside this fragment. 创建带有片段的任务流,然后将Tab的CONTENT放入该片段中。
  3. drag and drop this task flow with fragments TWICE into a page (as a region). 将带有TWICE片段的任务流拖放到页面(作为区域)中。 Each region must be enclosed in a af:showDetailItem component. 每个区域都必须包含在af:showDetailItem组件中。

In case there will be a differences between one tab content and another, you can add a parameters to the task flow and render content conditionally. 如果一个选项卡内容与另一个选项卡内容之间存在差异,则可以向任务流添加参数并有条件地呈现内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM