tags:

views:

23

answers:

0

I am a Dojo newbie and am trying to create a custom templated Dojo widget. What is the correct way to map a custom Dojo widget attribute to the text node of an HTML textarea element using an attributeMap? I would like to be able to set the value of the textarea while declaratively creating the custom Dojo widget. e.g. ... ...

<script type="text/javascript">
    dojo.require("dijit._Widget");
    dojo.require("dijit._Templated");

    dojo.addOnLoad(function() {
        dojo.declare("MyCustomWidget", [dijit._Widget, dijit._Templated], {
            txtComment: "undefined",
            templateString: "<div><textarea dojoAttachPoint="contentNode" rows='10' cols='20'></textarea></div>",
            attributeMap: {
                txtComment: {
                    node: "contentNode", // what should the correct mapping be to allow the 
                    type: "innerHTML"    // setting of txtComment declaratively above in the body?
                },
            }
        });
        dojo.parser.parse();
    });
</script>