I don't think is exactly what you want but I deal with a similar
situation using the %attr block.

I have a series of tabs across the top and a side menu that I
control/highlight using the %attr functionality.  I pass back info to
the main autohandler which makes sure the proper tab is pulled forward
and the item being accessed is highlighted on the side menu.

Underlying all of this I have a series of directories that correspond to
the tabs that contain an autohandler that sets an attribute, then the
individual components in the directory also set an "item attribute".

The main autohandler then uses the following code in the %init block to
grab the attributes and uses the values of $a_module and $a_item to
present the proper view to the user.

So main autohandler (/autohander):

<%init>
  my $a_module = $m->base_comp->attr('a_module'); 
  my $a_item   = $m->base_comp->attr('a_item');

  ...
</%init>

And autohandler in tab directory (/reports/autohandler):

<%attr>
  a_module => 'reports'
</%attr>

And in my component in the tab directory (/reports/my_millions):

<%attr>
  a_item => 'millions_report'
</%attr>

I hope this helps.

-Bill

On Wed, 2006-03-22 at 12:11 -0500, Jim Babcock wrote:
> Hello,
> 
> I'm wondering how best to pass information to compnents called in the 
> autohandler. I set up a horizontal menu that is highlighting the current 
> page's menu item using path info from $r, but I'm seeing limitations with 
> that method. I'd like to add a sub-menu, which complicates things, but the 
> real issue is that many of the applications I'm going to make available could 
> be found on more than one path... for example one of the reports may be 
> picked from the reports tab that will be available to one group of users or 
> from the departmental tab for another group.
> 
> So know I'm thinking that it might be best to pass the context and 
> sub-context for the menus as some sort of variable, but I'm not sure what the 
> best way to do that is. Should I set up a couple of global variables in the 
> apache conf, create cookies, add them to the request, can I pass it through 
> 
> Any help would be appreciated,
> 
> Jimbus
> 



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Mason-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to