Skip to Content

Master-Detail App and OData - performance optimized implementation

Hi all,

I am implementing an application as master-detail app based on OData calls. According to the user requirements the master list items should contain specific detail information which will also be shown in the detail view. As we are talking about HCM data which require structural authorisation checks the data selection in the backend has an impact on performance. For this reason I am trying to avoid reading the same data tables twice.

So what I am trying to avoid is the following:

1. EntitySet: OData call for the master list is doing a select for specific details (let's say A, B, C)

2. Entity: And when selecting a specific master list item the OData call for one specific OData entity is processing the same data selection and checks again to get A, B and C .

So the question is how could the detail view access the information of the master list item?
Using the routing mechanism only the key information is passed to the detail view in order to bind the context to this item and to access the specific item details via OData. But how can I show the already received data A, B and C in my detail view without reading them again from the backend?

Any ideas?

Thanks for your feedback.

Regards
Michaela

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Oct 18, 2017 at 10:00 AM

    Hello,

    You can use element binding for this. When your list item is pressed, in the press method, at your controller, get the whole data of the list item you have selected, then you can either set it to a JSON model and use it in your other views or prerform element binding (use the bindElement method).

    View :-
    
    <List id="list" items="{/entitySet}" >		
    					<items>
    						<ObjectListItem id="objlistItm" title="{Username}"
    							number="{Epay}" numberUnit="{Currency}" type="Active"
    							press="onListItemPress">
    							<attributes>
    								<ObjectAttribute id="objAtribute0" text="{Userid}" />
    								<ObjectAttribute id="objAtribute1" text="{Zdate}" />
    							</attributes>
    						</ObjectListItem>
    					</items>
    				</List>
    
    Controller :-
    
    onListItemPress: function(evt){
    				
    				var data_object = evt.getSource().getBindingContext().getObject();
    				
    			},
    

    Whatever data bound to the data object is stored in the data_object.

    Now you can either set it to a JSON model and set the model to your core , then get its reference in your detail view and bind the data.

    Or you can get the reference of your detail view controls and do element binding by using the bindElement() method.

    Hope this helps,

    Regards

    Add comment
    10|10000 characters needed characters exceeded