<div> I am currently working on the scenario page that I demonstrated at the recent Xerte Dev and I would like to be able to get this working in a pageTemplates environment, but the way routed pages currently operate will not transfer directly to a pageTemplates environment.
</div><div><br></div><div>What is required:</div><div>A value that the page author can set as a unique identifier for a page. This value will then be entered into the "destination" field of another page so that the second page can send the user to the first page when a condition is met. This value needs to be set from an xwd form.</div>
<div><br></div><div>Solution in Page Wizards:</div><div>Use the page icon's "Name" property. ( not ideal as this is not accessible from the xwd form)</div><div>When a page's destination field in an xwd form is populated with the name of a page navigation to that page is achieved by</div>
<div>1. use getChildByName to obtain the pages xml</div><div>2. obtain the pages index by using .index() method of the xml</div><div>3. use gotoPage(page's index) to navigate to the page</div><div><br></div><div>(the above is a little simplified but contains the key elements).</div>
<div><br></div><div>This method has a couple of problems</div><div><br></div><div>1. In Page Wizards the page's details are set up in the xwd form, but you have to remember to set the page "name" (and "title" for display purposes) in the page Icon's property page. Ideally there would be a way to pass the "name" value from the xwd form to the property page of the icon.</div>
<div><br></div><div>2. In Page Templates there is no way (that I know of) for the page author to access the "name" field of the page icon and hence no way to set up a unique identifier for the page that can later be used to access the pages index in either a framework or the interface.</div>
<div><br></div><div>3. In Page Templates the xwd form's "name" field is used to set the Page Title display. This compromises the use of the name field in the xwd for use as a destination as titles tend to be verbose and contain spaces and may not be unique, whilst an identifier field would ideally be concise and free of spaces. This could be solved by adding an optional identifier field to an xwd form but there still would need to be a way of using this to populate the page Icon's name field. </div>
<div><br></div><div>Is there an approach I can use that I am unfamiliar with or is this an opportunity for a new method to be added to the Xerte engine, e.g. a setPageName() method? </div><div><br></div><div>I note that rootIcon has a setPageTitle method but this does not appear to change the underlying page property, i.e. </div>
<div>if I create a page</div><div>set the page icon's title property to "eric"</div><div>run a script on the page with rootIcon.setPageTitle("fred"); </div><div><br></div><div>then when I preview the page</div>
<div><br></div><div>The preview displays the page title as "fred", </div><div>The page Icon's property page continues to show the title as "eric"</div><div><br></div><div><br></div><div>Kind regards</div>
<div><br></div><div>Johnathan</div><div><br></div><div> </div><div><br></div>