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