Change focus when creating concepts with multiple editors


I'm working on a project where a concept can have multiple editors, and I am struggeling a bit with how the focus is applied when a user creates a new concept. The focus seems to always be automatically on the last editor (or place in the editor) for the concept. I created a simple project to show my usecase:


I have two concepts:
Building and Resident
The building can hold [0..n] residents
Resident has two properties: name and age.


The recident has two editors, one for Name and one for Details, and the Building Editor includes both and differentiates with the use of context hints.
I want to manually set the focus to be on the first editor (only specify the name) and then let the user go down and fill in the rest whenever. I have added a screenshot of the current state, and the focus always goes directly to the orange colored property.

Any tips would be appreciated.

Comment actions Permalink

First, you should avoid having a single property mapped to two active editor cells, like "name" in your case. This can cause various editor consistency issues, when you edit the value. Using a R/O model cell in the detail for "name" would do just fine.

Second, the detail editor will still be stealing focus after you press any char in the "name" property cell. I suspect this is an editor issue that deserves investigation. Can you file an issue into youtrack for us, please?



Comment actions Permalink

It seems the editor that is selected is the one that is last in the presentation. This is independent of whether the editor is actually shown. If the editor is not visible, then nothing is selected.

We can arrange the editors such that they work with separate items of the concepts (such that the properties are only mapped to one place), but it does not look like this will solve the issue. In fact, having the same property at two places worked just fine, just the focus of the whole entity doe not work.

The problem we have is as follows: We have entities with a list of attributes each. These entities are initialized. For reasons of the user interface, we want to collect the initialization somewhat later in the document. So we show the attributes with their names and types first, and then with their initialization. What is a good pattern to achieve this behaviour?


Comment actions Permalink

I have been testing a bit with the adding of R/O model access where the same property is used multiple times. But it is as Vaclav mentions, the bottom most instance of the concept editors steals the focus after a keystroke, even if the property is read only. This makes the editor unselect the original (editable) property after a keystroke, and since the property is read-only, focus is not applied to anything by the looks of things.

Comment actions Permalink

So it seems we need to find a plan B as we cannot identify the primary editor ourselves.

We could wrap the name in a child, and then display all these children.

However, can we let the editor display only a (1:1) child of all the elements of a list? Of course, we can do this by invoking the editor for the element itself, but we want to avoid that due to the focus issue.


Please sign in to leave a comment.