Reusing grid in other pages (with related entity)

I have 2 entities, customer and tracking.
tracking has one customer.

when editing a customer, I want to show all its related tracking (trackingEntity.customer).
doing this with a grid is simple, but I want to reuse the tracking browse screen that was already created.
Inside customer edit, I added a panel with the view
image

But I can’t configure its data source. what is the proper way to reuse a view, but tweak the data source

Thanks

You should not use screens as frames. If you want to share some layout and logic between two screens, create a separate frame and use it in the both screens. The frame may not contain own datasources, it’s components can use datasources of the host screen (see the docs).

Thanks
Do you have a real life usecase that I can see?
Thanks

In this project you can see that expense-frame.xml components use the operationDs datasource that is defined not in the frame but in the operation-edit.xml screen that includes the frame.

@knstvk thank you. But unfortunatly I can’t really get from this example how would you reuse a screen with different datasource. Don’t forget that these are my first steps in the framework. trying to understand how to migrate current project.
Do you have another example where I can reuse screens with different datasource.

Thanks again.

@knstvk
I dont know if it helps.
But here is what i have. From customer edit edit, Im tring to load tracking list frame

https://bitbucket.org/avifatal/cuba-crm/src/90dea973c5e941466207f2896d28906c0f5ad2c4/modules/web/src/com/platform/crm/web/customerentity/customer-entity-edit.xml#lines-103

this is the tracking-browse-frame.xml

https://bitbucket.org/avifatal/cuba-crm/src/master/modules/web/src/com/platform/crm/web/trackingentity/tracking-browse-frame.xml

The tracking-browse-frame.xml should receive a different datasource when it is under customer (where cusotmer.id = …)

Thanks

Hi Avi,

So I think you just need to remove the datasource declaration from tracking-browse-frame.xml at all. Then it will be obtained from the host screen.

@knstvk thank you but I already try that.
Right now Im getting this error:

image

Thanks for your time!

GroupTable requires a GroupDatasource, so try to change the XML tag of trackingEntitiesDs in customer-entity-edit.xml to groupDatasource (and remove it from the frame).

Ok. it is working. thank you. brilliant feature.