$$(id) not working + change template value

Hello.

I am using a simple template inside a larger multiview like so:

{
id:‘theHeader’,
view:‘template’,
type: ‘header’,
template: ‘Header Placeholder’
}

What I am trying to do is first get a reference to this object using $$(‘theHeader’). Next I want to change the template value to some custom text.

The multiview switches to this view with no problem. Then I try this:

$$(‘theHeader’).setContent(‘My Header’);

and I get an error that $$(‘theHeader’) is undefined.
Also, is this the correct way to change the template value?

Thanks!

Hi,

You can use the setHTML method if you need to simply change template text.

The setContent() method expects that you should point to an HTML container that already exists in the DOM.

Hmm ok.