Login Register

Programmatically change Templated widget values?

Hi all,

I am currently trying to programmatically update a templated widget.

To provide a simplistic example, say I have the following template for a custom widget:

I want to programmatically update 'link' and 'text' above - but the link always retains the values passed to it when it was constructed, and I can't figure out how to refresh it (I did call this.startup() after altering the text and link variable values).

I tried using dojoAttachPoint and setting the innerHtml, but this appears to have the same issue - the link retains the values it contained when it was constructed, and I don't know how to refresh it. Calling this.startup() doesn't seem to do the trick...

I am sure I am missing something simple - any suggestions?

Thanks in advance...

The current templating system doesn't have this ability

So the current templating system doesn't do this, but you *can* use dojoAttachPoint. What you need to do differently is to set the href property of the node that you've got an attachPoint-reference to as well as its innerHTML.

--
Project Lead, The Dojo Toolkit
President, The Dojo Foundation