Skip to content

Documentation: sap.m.p13n.Engine and its helper classes documentation is inconsistent and unclear #3963

Description

@iljapostnovs

OpenUI5 version: 1.120.0
TS Types: 1.120.0

There are a lot of inconsistencies from typescript and API perspective when using sap.m.p13n.Engine.

  1. Let's start from looking into samples from UI5:
    image

sap.m.p13n.Engine.getInstance doesn't exist in the documentation and types.

image
image


MetadataHelper doesn't receive any parameters according to types and documentation

image
image
But it does in the code and the UI5 Sample:
image


SelectionController and the rest of the controller constructor according to types and documentation should receive id first and only then the settings, however, the sample and actual library code is different

Sample code from UI5:
image
Constructor from TS:
image
Constructor from documentation:
image
Constructor in the library itself:
image


Event handlers doesn't have proper types defined:

image


Long story short, all p13n Engine topic is unusable from TS perspective.


Additionally it is totally unclear how can I control the state of the Engine:

  1. How can I provide the list of already visible columns (or maybe already used sorters)? Doesn't seem that something can be passed to SelectionController, Engine instance doesn't seem to have anything for that as well, except applyState method which is experimental.
  2. What can be passed to Engine -> show method?
    image
    Where did "Columns" and "Sorter" come from? According to documentation they are the keys, but there is no information if those keys are something which is predefined, or maybe I should define them by myself. If they are predefined, what are the values? If they are not, where should I specify them?

Absence of answers on those questions makes usage of the Engine tricky.


My current task is to implement column visibility personalization for Grid Table and we are using version 1.108.*. There are 4 options to do it:

  1. Using standard showColumnVisibilityMenu for Grid Table, but it is deprecated since 1.117, so it makes no sense to use it.
  2. Using p13n Engine, but it is totally broken for TS
  3. Implementing totally custom Menu with reimplementation of standard menu items, which is recommended by documentation. Funny recommendation if you ask me :)
  4. Making totally custom p13n dialog.

4 options and all of them are poor. P13n Engine would be the best option, if it would have proper documentation and types.


It would be really nice if this could be fixed as a patch for 1.108.* as well, because I am forced to implement everything fully custom otherwise. Also it would be great if there would be some proper documentation and samples on how to use the Engine, current documentation state, as you can see, is chaotic and unclear.

Thanks in advance!

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions