I have a simple use case where I have an Invoice table and an Items table.
An Invoice can have many Items and an Item can be on many Invoices, therefore in my database I have an InvoiceItem table too (3 tables total, Invoice, Item and InvoiceItem).
I am using Spring Roo (version 1.3.2 with gvNIX addon (version 1.5). I am wondering if it is possible in the course of creating an Invoice, I can add InvoiceItems on the same page rather than then navigating to the create InvoiceItem page and filling that out separately?
Any advice appreciated.
This functionality is not implemented yet on gvNIX. I'll guide you about how to implement it but I can't give you the specific resolution.
To implement this, you must add some code on your file ~/webapp/WEB-INF/views/invoices/create.jspx to add a new InvoiceItem field on Invoice creation page.
Then you must push-in the method InvoiceController.create from InvoiceController_Roo_Controller.aj and edit it to handle the input from InvoiceItem field so that it will take the identifier from new Invoice record created and use it to create a new InvoiceItem record also.
Here is a sample project that implements an example of this functionality: https://github.com/frnore/gvnix-sample-detail-creating
I hope be helpful. Best regards.