Sumit,
One idea:
Maybe that will have you get started.
Mike
I will try that.
I was hoping I could render the html on the fly without having to create intermediate files.
Hi
Mike’s idea works. As an alternative…
For rendering a String attribute in a dom node:
if(this.contextObj!=null){
var n=dojo.toDom(this.contextObj.get('YourAttributeName'))
dojo.place(n,this.domNode);
}else{
}
For rendering the actual System.FileDocument in a dom node:
if(this.contextObj!=null){
dojo.hitch(
this,
require(
["dojo/_base/xhr", "dojo/dom"],
dojo.hitch(
this,
function(xhr, dom){
var ioArgs = {
url:
"/file?guid="+
this.contextObj.getGuid()+
"&changedDate="+
(new Date().getTime()),
handleAs:"loadNode",
node: this.domNode
};
xhr.contentHandlers.loadNode = function(req){
var n = dom.byId(ioArgs.node);
n && (n.innerHTML = req.responseText);
};
xhr.get(ioArgs);
}
)
)
)();
}else{
}
Sample HTMLSnippet widget setup (same in both cases, just your script changes obviously)