documentation icon indicating copy to clipboard operation
documentation copied to clipboard

Improve "Passing parameters to screen" section

Open alexbudarov opened this issue 5 years ago • 2 comments

Environment

  • Existing page: https://doc.cuba-platform.com/manual-7.2/opening_screens.html#screen_parameters

Description of the bug or enhancement

We see from time to time questions from users about how to pass parameters to screens. After taking a side look to this section, my personal opinion that it needs improvements:

  • I don't see clear enumeration that "you can do it by 3-4 the following different ways, pick the most convenient for you"
  • No sub-sectioning. The narrative quickly moves from one way to pass params to another one without full explanation. You need to fully and carefully read this chapter 2 times to understand all options.
  • No complete code samples. Working code samples is a must have! User should be able to copy-paste the code without careful reading. E.g. there are no example of screen controller code for "screen.setFancyMessage(message);" calling sample. Also generally you should start with code sample of the screen which is being opened first, because this is how most people develop code (valid first).
  • No mentioning of @WindowParam, though even CUBA developers still use this way, see this recently edited code: com.haulmont.reports.gui.report.history.ReportExecutionBrowser#filterByReports

alexbudarov avatar Jul 29 '20 07:07 alexbudarov

Also mention or give link to separate section with samples how to add screen parameters for standard actions (CreateAction, EditAction, PickerField.LookupAction).

alexbudarov avatar Jul 29 '20 08:07 alexbudarov

Also mention that you can also open screens by using screen facets (ScreenFacet, LookupScreenFacet etc)

A screen can be opened from the main menu, by navigating to a URL, by a standard action (when working with browse and edit entity screens), or programmatically from another screen.

alexbudarov avatar Jul 29 '20 09:07 alexbudarov