Sunday, February 23, 2014

Performance Tip for Webcenter - IDs of Container components

Tip - ADF has a concept of container components by which its child components will have unique ids when rendered as HTML in front end.

Eg :  Lets say Region 1 and Region 2 form a part of a same page.
If Region 1 is with id r1 have an input text component with id i1
and Region 2 is with id r2 have an input text component with id i1
The ids of  input components in the rendered HTML would be r1:i1 and r2:i1

So though the input text component's ids are same, unique value is assigned to them automatically when the UI tree is formed during ADF lifecycle 
cool right??

Lets see a con about this, Since all of the child component's id will be appended by the parent component's id in the front and lets say you have have inputTextComponent in the below location

PageTemplate:Region:PanelCollection:Table:InputText

now the id of InputText in the front end would be (assuming ids given for each container as below)

pgtemplate:region1:pcollection1:table1:input1

This would add up to the HTML size loaded in front end.

Lets see the impact with a real example - I do have a simple page with a af:table and i have given the Table ID with a neat name "TableOne".





Now lets change the  Table ID from "TableOne" to "T"

So just by renaming one container component 0.1 KB is saved, In a large scale application where there are multiple containers and child components are in a single page this would be effective to a good extent.

Always try to name your ids to a much smaller value as possible.

For your reference PFB the list of container components  -

af:calendar

af:carousel

af:declarativeComponent

af:navigationPane

af:panelCollection

af:query

af:quickQuery

af:region

af:pageTemplate

af:subform

af:table

af:train

af:treeTable

af:tree
af:Iterator

No comments:

Post a Comment