# In SAP UI5 render calling two times in custom control

SAPSAP UI5

In your custom control, there are two aggregation updates- setAggregation and addContent. When you use Aggregation mutators, it uses 3rd parameter to suppress invalidation.

It will insert the aggregation but suppress the invalidation since whole control will be rendered at the end it.

oControl.setAggregation("layout",oSavedButtonHLyt, true); // suppress invalidate

You should think that It should work same for “addContent”.

oSavedButtonHLyt.addAggregation("content", manageSavedSearch[index], true);

However, it doesn’t work as UI5 cannot determine automatically for the previous parent's suppress cos its aggregation will be moved. You have to note that property, aggregation or an association invalidates control when control does not overwrite its mutator method.

Published on 19-Dec-2017 11:34:18