Yep, this is what I meant - though what Martin suggests in the next message (full namespacing) is a step better once your codebase gets large enough to make it worthwhile.
The same thing also applies to top-level EL objects where (being less naive these days :), we put our EL-accessible objects off of #{adfFacesContext} (plus #{processScope}, which is our only other top-level variable). -- Adam On 1/9/06, Simon Kitching <[EMAIL PROTECTED]> wrote: > Adam Winer wrote: > > One > > of the items already on our todo list is moving all the functions, > > classes, and variables inside a single top level object. > > Using a single top-level object is something I've been considering > suggesting for a while. > > MyFaces could create a single "myfaces" object for javascript, then > attach any further scripting to that object as "methods". This reduces > the namespace pollution to a single name. > > Of course components can create their own "object", and attach it to the > global myfaces object as a member, and then hang their methods off that > object to avoid possible name collisions with other components. > > myfaces = new Object(); > myfaces.submitForm = function() {......} > myfaces.ajax = new Object(); > myfaces.ajax.someMethod = function() {.....} > > onchange="myfaces.submitForm()" > > Adam: is this what you meant? > > Regards, > > Simon >