Master-detail with inline editing

Hello, my first post here. Coming from MS Acess 2010 background. I have a quite large application(200+ tables, 500 forms etc) and MS Access is not suitable anymore for our needs. Checking Cuba for the last year and thinking about upgrading.

One critical feature is fast entry because we do several hundreds of documents daily. In my currently setup user can use TAB to move through form (please see attached pic) from start to finish and just press Enter when on Process button. MS Access is good for that because of linked tables, as soon as you move to a row in Lines it creates an empty row in a table for you. Also, huge plus is using combo box with lookup field(Client, Warehouse etc.)

Is this 100% possible in Cuba? I tried several demos and they have Add/Remove buttons for line items with another window which is not acceptable in my case.

invoice

Hi,

that should not be a big problem.

Attached you’ll find a example project as a starting point.

Here’s a screenshot of the order edit screen:

If you have further question, don’t hesitate to ask.

Bye
Mario

cuba-example-order-inline-editor.zip (79.0K)

order-edit

2 Likes

Hi Mario,

yes, it kinda looks like what I need. But as I said, I need to avoid Create button on Line items. Imagine this: you fill header(date, client etc.) and with a TAB move to Lines, first line is already created, you start filling it and second line is created and waiting for you to finish with current line and move to second etc.

Please check this video at 6.15 to see how it works in MS Access: https://www.youtube.com/watch?v=E8cP4dHZtVg

Second video, at 3.20: https://www.youtube.com/watch?v=JdzpHdhECvk

Regards,
Sladjan

Hi,

the create button in my example will create another column inline, instead of opening another screen. I thought this was your point. Generally, the whole cuba example is usable without the mouse. So in case of the above example, you “TAB” through your master data fields. After the master entity fields, the button is selected. Hit on ENTER and you’ll get another row in the lines item (or in case of a popup it will open the order line popup and the first element is selected as well, so you can just hit “TAB” for every field. To save the order line editor (in case of a popup, hit CRTL+ENTER and you will be back in the editor of the invoice. So what i wanted to say is: although the shortcuts might be slightly different you can enter data in a CUBA app very fast, if you know the shortcuts.

But you can also go a little bit more towards your UI pattern if this is not acceptable for you. You can create a shortcut for the create action like this:


 <action id="create" invoke="onInvoiceLineCreate" caption="mainMsg://actions.Create" icon="icons/create.png" shortcut="CTRL-ALT-N"/>

You can just delete it, in case you don’t need the button. The action will work even without button and only with shortcuts.

Additionally, you can create 10 entries in advance, so that you can just click into them (without using the create button / shortcut at all). The not used entries can be removed on save of the invoice.


    @Inject
    private CollectionDatasource<InvoiceLine, UUID> invoiceLinesDs;

    @Inject
    private Metadata metadata;

    @Override
    protected void postInit() {
        for (int i = 0; i < 10; i++) {
            createInvoiceItem();
        }
    }

    public void onInvoiceLineCreate() {
        createInvoiceItem();
    }

    private void createInvoiceItem() {
        InvoiceLine invoiceLine = metadata.create(InvoiceLine.class);
        invoiceLine.setInvoice(getItem());
        invoiceLinesDs.addItem(invoiceLine);
    }

bye
Mario

btw: here you’ll find the list of default keyboard shortcuts: https://doc.cuba-platform.com/manual-6.4/shortcuts.html

I think the combination of these tips you gave could give me good results. I won’t start coding for a couple more months. If decide to go with Cuba I will post results and ask more questions :slight_smile:

Regards,
Sladjan