In menu.mhtml, try to use $m->request_comp->name to decide which page is 
requested. 




Yujie Jiang    
Maxthon Web Team Leader
Tel:86-010-51651772-849
[EMAIL PROTECTED]

2008-10-25



发件人: Olivier Dehon
发送时间: 2008-10-25 20:10:59
收件人: mason-users@lists.sourceforge.net
抄送: 
主题: [Mason] [newbie] Menu management, is there a better way?

Hello,

I have created a 'tabbed menu' component that needs to know which page
is currently requested in order to display the corresponding tab as
'selected'.

The way I am dealing with this is as follows:

- Every page managed by a tab defines an attribute as per
   <%attr > menuitem = > 'mypageid'  </%attr >

- In the autohandler, I call:
   <& menu.mhtml, menuitem = > $m- >base_comp- >attr( 'menuitem' ) & >

- And in menu.mhtml, the code exploits the value of the menuitem
  attribute to highlight the corresponding tab

This works as I expect, but I find it a little cumbersome to manage, as
I need to maintain the consistency between the menu.mhtml and the attr
defined in each of the pages, let alone the fact that there needs to be
a menuitem attribute in each page.

Is there a better recipe for dealing with this situation?

Thanks in advance for your insights.

-Olivier



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Mason-users mailing list
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Mason-users mailing list
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to