cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carlos M. S. Bento Nogueira" <cm...@student.dei.uc.pt>
Subject Re: [cforms] convenience functions in flowscript event handlers?
Date Tue, 19 Jul 2005 13:55:47 GMT
Hi!
Check these code snippets from the DreamTeamExample
on webapps\cocoon\samples\blocks\forms\dreamteam

   <fd:on-value-changed>
   <fd:javascript>
   // this script can be found in team.js
    updateNameWidget(event);
   </fd:javascript>
   </fd:on-value-changed>

function updateNameWidget(event) {
   var value = event.source.value;
   var memberIdwidget = event.source.lookupWidget("myWidget");
}

Hope this helps.

Greetings,
CarlosN.



On Tue, 19 Jul 2005, Jean-Baptiste Quenot wrote:

> * Max Pfingsthorn:
>
>> Is there  any way how  I can define those  convenience functions
>> (e.g.  lookup(event,'../../some/path'))  once  and use  them  in
>> those   flowscript  snippets   in  <fd:on-value-changed/>,   for
>> example? Can I  just include them  in the sitemap like  usual or
>> are those scripts run in a different context?
>
> Just declare plain flowscript functions  in a script loaded by the
> sitemap.
>

-- 

Mime
View raw message