cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vadim Gritsenko <va...@reverycodes.com>
Subject Re: Flowscript function calls parameters
Date Sat, 14 May 2005 01:43:59 GMT
Sebastien Arbogast wrote:
> I've noticed something weird with sitemap and flowscript.
> I had made a syntax error in one of my matchers :
> 
> <map:match pattern="internal/repository">
>   <map:call function="displayRepositoryDetails()"/>
> </map:match>
> 
> Notice the two parenthesis after the name of the function parameter.
> Of course it's wrong as the function parameter is supposed to contain
> only the name of the function. But the thing is that when I ran my
> application to this point, the exception thrown showed that
> "displayRepositoryDetails()() was not found", which seems to mean that
> the flowscript call is made from the sitemap parameter is simply a
> concatenation of the function name appended by "()".

No, it's just the error message - it adds "()".


> So my question is : wouldn't it possible to use another syntaxt for
> passing parameters, something like :
> 
> <map:match pattern="edit-user">
>   <map:call function="editUser({request:/username})"/>
> </map:match>

Don't think it is desirable...


> with a natural flowscript function like this :
> 
> function editUser(username){...}

So just you know, sitemap parameters passing into the flowscript function 
arguments was supported, but was deprecated and removed some time ago.

Reason? Because such parameter passing depends on arguments positions, rather 
than parameter names. Using cocoon.parameters allows using parameter names, 
reducing chances for mistake.

Vadim

Mime
View raw message