SaintLike
SaintLike

Reputation: 9579

Entity Object to different pages

I'm using ADF BC and I'm stuck with a problem.

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

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

2 - Use two entity objects (one for each tab) and whenever a change is made to the page's content, the entity objects "sync"

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)

Upvotes: 0

Views: 68

Answers (1)

Florin Marcus
Florin Marcus

Reputation: 1657

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:

  1. use a single VO and a single EO
  2. create a task flow with fragments and put the CONTENT of the Tab inside this fragment.
  3. drag and drop this task flow with fragments TWICE into a page (as a region). Each region must be enclosed in a af:showDetailItem component.

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.

Upvotes: 1

Related Questions