Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion paramitized menus
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
bishop155  
View profile  
 More options Jul 21 2011, 7:15 pm
From: bishop155 <chrisjbishop...@gmail.com>
Date: Thu, 21 Jul 2011 16:15:55 -0700 (PDT)
Local: Thurs, Jul 21 2011 7:15 pm
Subject: paramitized menus
I want to create a Menu which has multiple items which differ in only
the parameter passed. I'm pritty close:

case class Test(id: String);

var test = Menu.param[Test]("Test-1", "Test-1",
                        s => {Full(Test(s))},
                        pi =>{
                                pi.id
                        }
                ) / "category" / * >> Loc.CalcValue(() => { Box(Test("1"))  } )>>
                Loc.Template(() =>
TemplateFinder.findAnyTemplate(List("category")).openOr(<div>Template
not found</div>) );

                var test2 = Menu.param[Test]("Test-2", "Test-2",
                        s => {
                                Full(Test(s))
                        },
                        pi => {
                                pi.id
                        }
                ) / "category" / * >> Loc.CalcValue(() => Box(Test("2")) )>>
                Loc.Template(() =>
TemplateFinder.findAnyTemplate(List("category")).openOr(<div>Template
not found</div>) );

val entities =  test :: test2 :: Nil;

SiteMap.enforceUniqueLinks = false;

But it always matches the first menu item, and never the second. is
there a way I can change the doesMatch_? function? (Ive successfully
managed to achieve this by writing a custom loc, wondering if theres
another/better way to do it?)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.