How to retrive the contents of a canvas inside a window

Created a window with a canvas. Need to get/set the contents of the canvas. But not able to find the right method.
<code>
isc.Window.create({
title: “Results”,
autoSize: true,
canDragReposition: true,
canDragResize: true,
items: [
isc.Canvas.create({ID:“innerCanvas”,height:“100%”,width:“100%”,contents:“Hello World”})

]   });

</code>

Did not find method like getItems(). Used getMembers(). No luck. Will you let me know what is the right method to access the canvas/any item placed inside the window.

Hi gomathy,

You can just use innerCanvas.setContents(newHTML) - no need to go through the Window. However, if you did want to go through the Window, window.items is allowed to be directly read.

Thanks!! I am using isc inside an integrated environment where any widget will be accessed anywhere thru a global handler. And global handler will know only the outer elelments & not the children (like canvas in this case). With mywindow.items[0] was able to access the canvas.

But here is another question. Is it possible to get the HTML contents which is displayed in the HTMLPane.

<code>
isc.HTMLPane.create({ contentsURL:“info.htm”, contentsType:“page” })
</code>

The info.htm page gets loaded & its html contents gets rendered. How can I access the contents rendered. (not able to make it thru - contents / getInnerHTML)

You could fetch the contents separately via the RPCManager by setting serverOutputAsString, then use setContents() to apply them to the “innerCanvas”. This would also eliminate your use of contentsType:“page”, which we recommend against except in rare circumstances.

If you let us know what you want to do with the content and/or give us an idea of the purpose of the application from a user perspective, we could provide more targetted advice.