cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ugo Cei <u....@cbim.it>
Subject Re: [Proposal] Implementing XMLForm with Flow
Date Mon, 23 Dec 2002 10:56:27 GMT
Ovidiu Predescu wrote:
> Not really. You can automate this task by arranging in your sitemap to 
> call a function that checks the login first, instead of your function. 
> The following will do it:
> 
> Sitemap:
> 
>   <map:match pattern="someUri/checkout">
>     <map:call function="checkLogin">
>       <map:parameter name="funarg" value="checkout"/>
>     </map:call>
>   </map:match>
> 
> Flow:
> 
> var user;
> 
> function login()
> {
>   // send the necessary pages for the user
>   // to login. Assigns to the global 'user' variable
>   // the User object, which is later used throughout
>   // the script to identify the user. See the prefs.js
>   // sample in Cocoon for an example of such a function.
> }
> 
> function checkLogin(funarg)
> {
>   if (user == null)
>     login();
>   funarg();
> }

This doesn't seem to work. It always generates an error message like 
"org.mozilla.javascript.EvaluatorException: checkout is not a function."

But if I invoke the same function directly from the sitemap, without 
passing its name as an argument, it works.

What's happening here?

	Ugo


-- 
Ugo Cei - http://www.beblogging.com/blog/



---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message