NetTalk Central

Author Topic: Page Header Tag  (Read 2811 times)

bryce

  • Newbie
  • *
  • Posts: 24
    • View Profile
    • Email
Page Header Tag
« on: October 04, 2013, 10:47:17 PM »
I am trying to work out how to display the number of records in a table on the Page Header Tag (part of my experiments in doing a shopping cart).  Using Webserver example 1 I am displaying and updating a session variable on the Page Header Tag to see what happens.

This is updated perfectly from the browse when a record is inserted but not when a record is deleted.  I assume that when a record is inserted the Page Header Tag is 'refreshed' but when a record is deleted it isn't.  Why is this and how do I force the refresh to happen when a record is deleted?

Thanks,

Bryce

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Page Header Tag
« Reply #1 on: October 06, 2013, 10:54:05 PM »
Hi Bryce,

The specific answer to your question will depend on all sorts of factors. To cover as many possibilities as possible I'd do this in the following way;

a) In the Page header embed another netwebsource, rather than including the session value directly. In other words;
instead of
<!-- Net:s:whatever -->
have
<!-- Net:CheckoutItems -->

where NetCheckoutItems is just a small NetWebSource which contains
<!-- Net:s:whatever -->

This allows "just this part" of the header to be updated, rather than having to recreate the whole header (including menus etc.)

b) In "appropriate" places (ie whenever you want the header to be updated) just call
CheckoutItems(p_web)

Obviously the appropriateness depends on exactly what is in the header, but in the case of a Delete this would be the deleteb event in the TakeEvent routine in the browse.

Cheers
Bruce





bryce

  • Newbie
  • *
  • Posts: 24
    • View Profile
    • Email
Re: Page Header Tag
« Reply #2 on: October 06, 2013, 11:55:05 PM »
Thank you Bruce.  I will give your suggestion(s) a try.

Bryce