NetTalk Central

Author Topic: Passing data on a page header menu  (Read 3072 times)

sukhendu

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
    • Email
Passing data on a page header menu
« on: March 26, 2012, 09:19:07 AM »
Looking for an embed point on the Page Header when a menu is clicked is clicked.

I have two Browse Menus on the page header and both point to BrowseClients.  Clients table has CLIType byte field.  I want to pass CLIType when a Browse Menu is clicked.header.

I put this code in --- Menu Item ---  'Browse'  --- 'Customer'   ! Start of "Before Menu Item"     ! [Priority 5000]
    p_web.SetSessionValue('aCLIType',1)       

And  !--- Menu Item ---  'Browse'  --- 'Supplier/Producer'     ! Start of "Before Menu Item"     ! [Priority 5000]
    p_web.SetSessionValue('aCLIType',2)         

But CLIType becomes 2 no matter which browse is selected.

Thanks,
Sukhendu

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Passing data on a page header menu
« Reply #1 on: April 01, 2012, 11:28:20 PM »
Hi Sukhendu,

It's always 2, because those embeds you are embedding in are done when the menu is generated, not when it's clicked.

there are no embeds when it clicks, because the click itself does something. If there was an embed, it would be asynchronous, and hence useless for "setting something before the menu click applies".

It sounds to me like you just need to pass a parameter to the browse. For example
'BrowseClients?aCliType=1'
and
'BrowseClients?aCliType=2'

Then in browse clients, top of GenerateBrowse routine put
p_web.StoreValue('aCliType')

then use p_web.GSV('aCliType') in your code, filters etc as normal.

cheers
Bruce



sukhendu

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
    • Email
Re: Passing data on a page header menu
« Reply #2 on: April 03, 2012, 08:26:39 AM »
Thank you Bruce.  Yes, I'm trying to send 1 or 2 to BrowseClients procedure.

It worked!.  Can multiple values be passed using comma (like 'ProcedureName?pV1,?pV2) ?

Sukhendu

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Passing data on a page header menu
« Reply #3 on: April 04, 2012, 05:42:34 AM »
no, the separator is not a comma, it's a &.
So, for example;
'procedureName?parm1=hello&parm2=fred'

sukhendu

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
    • Email
Re: Passing data on a page header menu
« Reply #4 on: April 04, 2012, 07:21:12 AM »
Thanks Bruce.