[Xerte] use of isFunc and passing of parameters
johnathan.kemp at ntlworld.com
johnathan.kemp at ntlworld.com
Sun Apr 18 22:33:38 BST 2010
Just to clarify my first posting.
I originally tested the second method, that of calling the function from a script e.g. navToPage(parameter1,parameter2,parameter3), but found that only parameter 1 was passed through to the function as args[0]. args[1] and args[2] were undefined. However this still left me with the situation where if I had two wizards.
The routed hotspot wizard that called the function from a script using navToPage(destPageName)
and
The routed text wizard that called the function using href="asfunction:_level0.engine.navToPage,destPageName"
Pages created with the routed hotspot wizard work fine until a page based on the routed text wizard is used to redirect the user to a page based on the routed hotspot wizard. At which point the args[0] from the routed text page appears to persist so that the routed hotspot page effectively redirects to itself, rather than the page name passed to it.
The only solution appears to redefine args[0] to the destination page and then call navToPage(destPageName)
I hope this makes things a bit clearer.
Any ideas as to what is happening here and how to modify things so that the parameter is passed correctly, without the work around would be much appreciated.
Kind regards
Johnathan
---- johnathan.kemp at ntlworld.com wrote:
> I am developing a couple of page wizards, both of which provide the capability to define exit points from the page.
>
> The first is a text page that allows you to define hyperlinks to other pages in the project. This is supported by a script where isFunc = 1.
>
> I am calling it with
>
> <a href="asfunction:_level0.engine.navToPage,rtFinal" target="_blank">Routed Tab</a>.
>
> The destination page name, in this case rtFinal, is received as args[0] in the script navToPage. It appears only possible to pass one parameter.
>
> I have a second wizard based on the hotspot in which any hotspot can have a destination page assigned to it. I have a similar function script in this wizard which is called by the script that runs when the hotspot is clicked on.
>
> This script calls the function by navToPage(parameter1,parameter2,parameter3)
> The results are received by the script in args[0],args[1],args[2]
>
> All has worked well when the pages work in isolation, but once the text page has been run this then appears to define the args array at a level that dominates over the hotspot page. The only way I can get this to work is if I set args[0] before I call the function and then pass args[0] as a parameter, otherwise it picks up the value of args[0] set by the text page.
>
> Can anyone shed any light on what is going on here?
> Do I need to declare a new array args at the start of every page?
> How would you operate two functions in a page if every function is going to handle its parameters as the same array args[]?
>
> Kind regards
>
> Johnathan
> _______________________________________________
> Xerte mailing list
> Xerte at lists.nottingham.ac.uk
> http://lists.nottingham.ac.uk/mailman/listinfo/xerte
More information about the Xerte
mailing list