Forum OpenACS Development: Re: Ajax Helper 0.8d committed to CVS HEAD

Collapse
Posted by Hamilton Chua on
Hello Malte,

My responses inline ...

a) How can I pass the header_stuff variable from an include to the master template?

The only way I know how to do that is thru global variables. In fact if you check ajax/doc/ there are instruction on pasting some code into your blank-master files to enable auto loading of javascript sources when you use helpers.

This means that if you use ah::effects, for example, and you have that piece of code in the blank-master, you won't need to worry anymore about what javascript source files to load as this will be taken cared of by ajaxhelper.

The intention is to take away the guess work, to minimize effort of using ajax and to prevent double declaration of js sources.

This mechanism is still a bit messy and I'm in the process of refactoring but it should work ok on 0.8.

So for ajax-file-storage, you might want to use global variables in your template files if you intend to make it an include.

b) How can I make the ajax-filestorage-ui view open the folder contents of the main folder by default ?

Looking at index.tcl, look for the comment "#create node". You'll see a list of items. On the particular file storage instance where you want it to open just add "1" to the list after "${dyn_load_script}". If you check the code in ajax-yahoo-procs.tcl you'll see that the item corresponds to -open which tells the tree to open the partcular node/folder.

So as the code loops thru all the fs_instances, you have to put a check for the file storage instance you want opened by default and add "1" to the list.

I hope that helps.