Well, putting it in startup() works for both programmatic and declarative.   Any code referencing id should be removed from buildRendering().

Probably a better place than startup() is refreshRendering()?