Properly set `Fragment` as a `PopupView` content

Hello, as I mentioned in topic, I’m trying to add a fragment to a popup, which is created in generated column in table of an entity browser. And I want data on a fragment to depend on a selected row of table.
What is my preset:

  1. Fragment with a table and datacontainer
  2. Browse screen, which contain a fragment (and works fine)
  3. SampleEntity browse screen with a simple group table

What am I doing:

  1. create a generated column
  2. programmatically create a popupview
  3. programmatically create a fragment
  4. set a new loader query for fragment
  5. added fragment to a popup (popup.setContent(fragment.getFragment());) <- that was really not obvious

Now my fragment is shown, but captions are not shown, buttons are not working, and the table looks infinite.

Probably this whole thing is wrong, and you can help me figure out how it’s done properly. Thanks in advance


Even though a fragment can be used as popup content, it’s better to keep its layout simple. Otherwise, you need to properly implement it. For example, actions are loaded using the post init task mechanism, since they usage and implementation separated in XML descriptor. Because fragments intended to be a part of a screen, these post init tasks are invoked during a screen creation. In your case, no post init tasks are called because the screen has already been created. I’d recommend creating actions programmatically. A screen fragment intended to be used as popup content must have a proper size, i.e. fixed size since a popup view has an auto size. Also, I would recommend passing ScreenOptions object since you want the data on a fragment to depend on a selected row and loading data programmatically depending on the passed options.

The simpler solution is to open a dialog window instead of using a popup view.


I see, thank you. the idea was in creating popups for every table column e.g. user profile popup, comments popup, item type description popup, etc. maybe I’d consider refuse using actions and make my popups read-only, but leave a non-actionable table, so that I’ll need to provide ScreenOptions and, I guess, a dataContainer, thank you for this hint… I guess my current topic doesn’t have a proper solution, because of a wrong original idea