This is a short tip on where to add the <af:resource type="javascript"> tag when you want to include javascript in your adf page fragment. The place to include the tag is inside of a root component layout like panelFormLayout or panelGroupLayout because otherwise if you place it outside of the root component the resource might not be loaded and hence your script method will not be found which can sometimes lead to issues with the user interface also because a javascript error will prevent panelStretchLayout from stretching. But if you place it inside the root component layout the script will be loaded always.