<HTML dir=ltr><HEAD><TITLE>RE: [Xerte] Using getPageIndex() to fill an array</TITLE>
<META http-equiv=Content-Type content="text/html; charset=unicode">
<META content="MSHTML 6.00.6001.18248" name=GENERATOR></HEAD>
<BODY>
<DIV id=idOWAReplyText25033 dir=ltr>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2>we should rebrand - new name - XIII</FONT></DIV>
<DIV dir=ltr><BR>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> xerte-bounces@lists.nottingham.ac.uk on behalf of Julian Tenney<BR><B>Sent:</B> Wed 24/06/2009 21:48<BR><B>To:</B> Xerte discussion list<BR><B>Subject:</B> RE: [Xerte] Using getPageIndex() to fill an array<BR></FONT><BR></DIV></DIV>
<DIV dir=ltr>
<DIV id=idOWAReplyText87224 dir=ltr>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2>You need to wait for Xerte 3.0.</FONT></DIV></DIV>
<DIV dir=ltr><BR>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> xerte-bounces@lists.nottingham.ac.uk on behalf of Paul Swanson<BR><B>Sent:</B> Wed 24/06/2009 21:26<BR><B>To:</B> Xerte discussion list<BR><B>Subject:</B> RE: [Xerte] Using getPageIndex() to fill an array<BR></FONT><BR></DIV>
<DIV>
<P><FONT size=2>"I seek the Holy Grail." ;o)<BR><BR>See Julian's reply for your answer.<BR><BR>______________________________<BR><BR> Paul Swanson<BR> Instructional Designer<BR> Harland Financial Solutions<BR> Paul.Swanson@harlandfs.com<BR>______________________________<BR><BR>________________________________<BR><BR>From: xerte-bounces@lists.nottingham.ac.uk on behalf of Fred Riley<BR>Sent: Wed 6/24/2009 10:16 AM<BR>To: Xerte discussion list<BR>Subject: [Xerte] Using getPageIndex() to fill an array<BR><BR><BR><BR>Ok, this might take some explaining, so apologies in advance for the<BR>length and abstruseness of the message. I'm trying to complete a Xerte<BR>application which was partly finished over a year back by a colleague<BR>who then had a bad car accident then recovered and moved on to better<BR>things. The application looks pretty well put together, as the colleague<BR>did it in consultation with Julian, so I'm not being critical at all,<BR>but as any coder will know it's always hard to dissect someone else's<BR>work particularly when there are no application notes to consult.<BR><BR>The current version of the application is online at<BR><A href="http://www.nottingham.ac.uk/~ntzfr/rlos/mentoring/test/ruefulrabbit.htm">http://www.nottingham.ac.uk/~ntzfr/rlos/mentoring/test/ruefulrabbit.htm</A><BR>(Xerte XML file at<BR><A href="http://www.nottingham.ac.uk/~ntzfr/rlos/mentoring/test/mentoring_ruefulr">http://www.nottingham.ac.uk/~ntzfr/rlos/mentoring/test/mentoring_ruefulr</A><BR>abbit.rlo). As the user goes through each section, s/he is invited to<BR>type reflective text into fields on some pages, then that text should<BR>get presented to the user for further reflection and printing in a<BR>summary page at the end. The user text is held in an array 'texts'<BR>initialised in an opening framework by:<BR><BR>texts = new Array();<BR><BR>On each page where there's a text field, new elements are added to the<BR>array containing the user input:<BR><BR>texts[rootIcon.getPageIndex() - 2] = icon.parentNode.clip().text;<BR><BR>The minus figure varies from page to page in a not clear, to me, way.<BR>Julian writes that getPageIndex() "tells you the current page number on<BR>rootIcon" and then goes on to qualify this with "getPageIndex() - 1 is<BR>required if the first child of the interface is an entry frame". I think<BR>I understand this, but when I try some traces to find out what<BR>getPageIndex() is returning, such as below:<BR><BR>pagenum = rootIcon.getPageIndex();<BR>debug("page index: " + pagenum);<BR><BR>the same value (in this case 2) is returned. That's probably all as<BR>clear as mud, but this is complex to explain in text without the<BR>application on screen. My questions are:<BR><BR>1. What is it that getPageIndex() is returning, and why is it always the<BR>same value regardless of which page it's on?<BR>2. Is there a better way of adding array elements page by page?<BR><BR>I could really kludge it and manually set the texts array element<BR>number, eg:<BR><BR>i = 10; // or whatever<BR>texts[i] = icon.parentNode.clip().text;<BR><BR>but that would fail if I then added or removed pages. Any suggestions?<BR><BR>Thank you for your time. I'm now off for a little rest after all that<BR>typing :o)<BR><BR>To use a Pat method to see if you've read this far: What is your quest?<BR><BR>Cheers<BR><BR>Fred<BR><BR>Fred Riley<BR>Learning Technologist<BR>School of Nursing, Midwifery and Physiotherapy, University of Nottingham<BR>Vcard: <A href="http://www.nottingham.ac.uk/nursing/sonet/about/fr_uon.vcf">http://www.nottingham.ac.uk/nursing/sonet/about/fr_uon.vcf</A><BR>_______________________________________________<BR>Xerte mailing list<BR>Xerte@lists.nottingham.ac.uk<BR><A href="http://lists.nottingham.ac.uk/mailman/listinfo/xerte">http://lists.nottingham.ac.uk/mailman/listinfo/xerte</A><BR><BR><BR><BR></FONT></P></DIV></DIV></BODY></HTML>