Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue when the predicate, in the sortedBy() service, returns null #36

Open
pcdavid opened this issue Aug 11, 2023 · 0 comments
Open

Issue when the predicate, in the sortedBy() service, returns null #36

pcdavid opened this issue Aug 11, 2023 · 0 comments
Labels
bugzilla Issues migrated from the old Eclipse Bugzilla

Comments

@pcdavid
Copy link
Member

pcdavid commented Aug 11, 2023

πŸ†” Bugzilla ID πŸ“˜ Project πŸ—“ Created ❓ Status
#566743 Sirius / Core 2020-09-07T15:58:20Z UNCONFIRMED

Comment #0 on 2020-09-07T15:58:20.000Z:
For example, use a tree item mapping to display a list of objects in a tree.
You want to display these objects, sorting them by their name.
So, you use the Sirius service: sortedBy(o | o.name) on this list.

Elsewhere, you can use a reference widget in order to create a new object and to reference it in this list. Note this action may create an empty object. So, if this one contains the feature name, name will be null.

In runtime, if you creates a new object (by this widget i.e.) in a list sorted with this service, this will involve an issue to display the list of items.
Indeed, all the items will not display anymore (as long as one of the objects (at least), from the list, owns a name null).

A workaround consists in using:

  • Either his own Java service to sort (and to manage the null case)
  • Or, his own service to get the name as an empty string (or default string) instead of null

Comment #1 on 2020-09-07T16:52:49.000Z:

  • Unzip the file in your workspace (my.project2.design)
  • Launch a runtime
  • Use a basicfamily model
  • Select the viewpoint "MyViewpoint"
  • Select the Family object (root object)
  • In the properties view, select the page named "sortedBy(p | p.name) with a name null".
  • You see a group with a reference widget which displays the list of the persons in the selected family and a list widget which displays these ones sorted by their name.
  • Right click on the Family object, in the model explorer view > New Representation > new family. You get a tree representation with the list of the persons in the family, sorted by their name.
  • Select again the Family in the model explorer view and come back on our page in the properties view.
  • Click on the button "+" and Finish (creation of a Man).
  • You see a Man without name, added in the reference widget (OK)
  • The list widget has not changed at all (NOK)
  • The tree representation is empty (all the persons have disappeared) (NOK)
@pcdavid pcdavid added the bugzilla Issues migrated from the old Eclipse Bugzilla label Aug 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from the old Eclipse Bugzilla
Projects
None yet
Development

No branches or pull requests

1 participant