Nested Data Source View

Dear All,

In my billing application, each time the user generates an invoice, a new entry is written in the “BillingCycles” entity, and the generated invoice lines in the “Billings” entity.
I am working on a new screen which allows the user to create manual adjustments on the system generated invoice (which corresponds to one billing cycle and many billing lines)
In the pending invoice screen (screenshot attached), the user selects the billing cycle and the system displays the generated billing lines in the top part.
The user should be able then to create adjustments in the lower section of the screen (screenshot attached) - (and then later posts them by click on the post button).
On my BillingsCycles entity, adjustment is an attribute of type ASSOCIATION, and the data source of my adjustments table is a nested adjustments datasource.

I am facing 2 issues mainly (the first one is solved I guess):

  1. When the user saves a new adjustment, nothing is committed to the database. I think this is due to the header-detail architecture. So the detail is not saved unless the header is saved. However, in my case, the header “BillingCycles” has not changed, so the system is not able to save the adjustment. To overcome this issue, I have programmatically saved the record by calling a service bean when the user clicks on Save. Is this the proper way of handling it?
  2. As you can see in the attached snapshot, I am not able to display descriptions in the adjustment table, only IDs. This is because I cannot choose any view for the nested datasource. I had to put all fields for the adjustments entity in its instance, so that I can use them in the nested datasource of my adjustments table.
    How can I overcome this limitation?

I have attached the code for the pending invoice and adjustment editor screens.
Thank you for your usual help.

Shady Hanna.

NewAdjustment

PendingInvoice

BillingAdjustmentsEdit.java (910B)

billing-adjustments-edit.xml (3.1K)

PendingbillingsBrowse.java (3.1K)

pendingbillings-browse.xml (8.4K)

Dears,

Please ignore my second question. I managed to get it fixed.

Still would like to know your feedback about the first question. Thanks in advance.

Hello Shady,

It’s hard to say what’s going on by seeing just screenshots and fragments of a complex project. Could you provide a sample project with a minimum of code where we could reproduce your issue?