I am developing an ASP.net web app using iui for the front end
(targeted for the iPhone). I have a main page in which I've added a
second "navBar" underneath the standard iui navBar. I use this second
bar as a toolbar that has some buttons to allow the user to toggle
between different views of the main page. When the user taps one of
the buttons, I am making an AJAX call to the server to update the main
view. The buttons on the tool bar need updating so I've added some
custom target="_replace" code so I can replace out a specific item
within the page, in this case the <body> element.

I'm fairly certain I'm returning the correct html from my ASP.net.
Tapping one of these buttons results in a page as I'm expecting. I've
added the javascript function below to replace out the body of my page
(all of the buttons have target="bodyReplace" and my body has
id="bodyReplace":

<code>
function replaceElementDirectly(source, targElem) {
      var target = document.getElementById(targElem);
      var targetParent = target.parentNode;
      var frag = document.createElement(target.localName);
      frag.id = targElem;
      frag.innerHTML = source;
      targetParent.removeChild(target);
      targetParent.appendChild(frag);
   }
</code>

The problem occurs when I try to navigate to the next layer in my data
hierarchy. My main page is not scrolling out of view when the next
page comes in. For example if my main page has a list of 5 items, and
my next page has a list of 2 items, my resulting list will look as
follows:
<code>
<ul>
<li>2ndLayer1 overtop 1stLayer1</li>
<li>2ndLayer2 overtop 1stLayer2</li>
<li>1stLayer3</li>
<li>1stLayer4</li>
<li>1stLayer5</li>
</ul>
</code>

When I click the back button, the last three items will disappear and
the original first page will slide back into view, looking as it
should have been. If I then go to the same 2nd-level page, it will
display correctly with only the 2 data items in the layer.

I'm not seeing any differences in my page history ids, or any of my
div ids. Any suggestions would be greatly appreciated.

Thanks.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"iPhoneWebDev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/iphonewebdev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to