Custom control modified to prevent resetContent when using SSJS, plus some other cleanup of the sample XPages. Also design definition added to the custom control.
If you don't want to download the new custom control, you can just add "&resetContent=false" to the headingBackPage property on the custom control.