problem with using refresh() on an Active.HTML.DIV?
div1 = new Active.HTML.DIV;
// now lets assume other things happen here, over time, and then
// later we want to add a div to div1
// everything I do is on the fly and the page
// never gets 'refreshed' it just gets pieces of
// it changed via scripts
div2 = new Active.HTML.DIV;
div1.setContent("html", div2.toString()); // have also used just div2 but got the same results
// if there is a better, more correct way to
// add one Active object to another let me know
alert(div1); // you get the exact result you would expect to get
div1.refesh(); // to display the first DIV with it's new div inside
// note that it doesn't work
alert(div1); // note that this alert never happens, what happened to
// the script?
div1.refesh(); instead of div1.refresh(); otherwise the script works fine.
create div2 and parent it with div1
create div3 and parent it with div2
so now I have something like:
<div id=1><div id=2><div id=3></div></div></div>
if I now try and add another div (div4) to div1 I loose div3. I get something like:
<div id=1><div id=2></div><div id=4></div></div>
I think that when I am adding div4 and I use a line like:
div1.setContent("html", div1.getContent("html") + div4);
the result of div1.getContent("html") is not correct. It is missing div3 and the id for div2 is listed as div1/html instead of div2 which I have it set to. So it looks like the bug is in getContent("html"). Is there another way to return ALL of the "innerHTML" of the div, other then getContent("html"), that I am missing here? how would someone else code the scenario that I have presented here and make it work?
Thanks Alex for your help so far. I think once I get over this hurdle I can start to write some test cases for regression testing (future version compatibility) and be on my way.
I think it would be 'cleaner' to stick with the built in methods, but at this point I am happy there is a solution.
This topic is archived.
Back to support forum
Version 2Looking for AW 2.6 ?
The old site is here.