Use a windowActionsFrame in a Lookup screen

Hi

I have small entities that I do want to be edited inline in a table instead of havin an Editor screen with only two fields.

I created a Lookup screen with an inline editable table to do so following advices here.

Then I wanted to add a windowActionsFrame as we can find in Editor screen to have “ok” & “close” buttons (Lookup screens do not have buttons as you know). I need that because my screen is a dialog and a dialog without buttons is strange.

But then CUBA complained that it can not find “windowCommit”. I guess that standard windowActionsFrame can not be put in Lookup screens because only Editor initializes windowCommit and windowClose actions.

I then tried to derive the screen from Editor instead of Lookup. But then it complains that it cannot find a main Datasource. Which is true as the main component (the table) uses a collectionDataSource. And I cannot change it to main Datasource because table needs a CollectionDataSource or equivalent.

So I finally built manually myself a frame with ok and close buttons invoking appropriate Window methods commit() & close(). This is a bit annoying to bypass the framework, because everything needs to be redefined manually : messages pack, keyboard shortcuts, decsriptions, etc.

Was there another solution that I missed ? If the answer is no I will (try to) create a template with my screen.

That would be great to be able to put the windowActionsFrames outside of an Editor screen (e.g allowing it to work with collection datasources).

Beyond that, the use case “entities edited inline in a table instead of having a dedicated Editor” could be a template in a future Studio version. This is a common use case.

Mike

Hi,

you are right, windowActionsFrame is mostly tied to an editor. You can probably find a way around it, but instead of doing all the inline editing and all the problems that arise with it, why don’t you just use the combine browse/edit template from studio? This is pretty much the same as inline editing and with this you will not have to do any programming to make it work. Just an idea.

Bye
Mario

Yes, I thought about the combo browser/editor, but in my case Entity is very simple (2 fields), so this is not very elegant.

Moreover, this Entity is typically the one you want to edit line by line like in Excel (list of accounts).

I’m currently working on two things :

  • a generic window actions Frame with two actions replicated from the standard WAF, forwarding commit() & close() to its parent Window & DsContext() (done, working)
  • a generic table inline edit Window using the previous frame (in progress)

I will probably push the exercise into making a table inline edit Frame for other simple entities I have, that I want to be edited inline in an already complex Editor.

For now I did not meet any quirk I was not able to solve. Once finished I would be glad to share this code in order to get expert view on it. I aim to make a Studio template with it.

Hi Michael,

We appreciate if you share your template, just please take into account that templates API has been changed significantly in Studio 6.5, so it would be better if you make your template for 6.5. I’m sure there will be no such changes in the future and the API will be stable.

I’m currently struggling on another issue currently, but I will revert on this point once it is solved.

On this particular topic, I saw that DataGrid in 6.5 seems to fit perfectly my use case. So I will likely move forward and use it.