NetTalk Central

Author Topic: Get unrelated browse to update, shopping cart style  (Read 3765 times)

JohanR

  • Sr. Member
  • ****
  • Posts: 366
    • View Profile
    • Email
Get unrelated browse to update, shopping cart style
« on: March 13, 2011, 06:23:00 AM »

Hi,

I have a shopping cart browse that I would like to update,
The cart browse is always visible as the client moves around the website and there are various places in the website that adds records to the shopping cart list.
How do I get the Cart browse to know that there are new records and that it should update itself?

thanks

Johan

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11245
    • View Profile
Re: Get unrelated browse to update, shopping cart style
« Reply #1 on: March 13, 2011, 11:02:44 PM »
you can call it from inside your code;

BrowseLineItems(p_web)

now depending one the exact circumstances, you may need to add one or more of the following lines;

p_web.DeleteValue('_EIPClm')
p_web.DeleteValue('_Clicked')
p_web.DeleteValue('_EIPRow_')
p_web.DeleteValue('_CallPopups')

most notably, where those values might exist before the call.

Because you are altering values, you also probably want to do this pretty "late", after all the other processing has been done, especially for Ajax calls. And I'm guessing it's only really ajax calls that you need to do this on (page calls would presumably just update the cart in the normal way.)

Cheers
Bruce

JohanR

  • Sr. Member
  • ****
  • Posts: 366
    • View Profile
    • Email
Re: Get unrelated browse to update, shopping cart style
« Reply #2 on: March 15, 2011, 03:07:39 AM »
Hi Bruce

I tried the straight call to the browse and that does not work if in the server code of a button,
what I have found is that it works very well if I put it in the AjaxChildren routine in the browse that is doing the adding to the cart,
except it seems not to fire every 10th time or so.
Next time it fires it updates with the previous event, so the total items will jump from 3 to 5.
Hope my explanation makes sense.

Still looking into it.

thanks

Johan



JohanR

  • Sr. Member
  • ****
  • Posts: 366
    • View Profile
    • Email
Re: Get unrelated browse to update, shopping cart style
« Reply #3 on: March 15, 2011, 10:45:34 AM »
Hi

The 'CallBrowse' routine in the cart browse is executed every time,
but sometimes it does not update the browse.

What is the best routine to debug and check to make sure the browse updates?

thanks

Johan


Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11245
    • View Profile
Re: Get unrelated browse to update, shopping cart style
« Reply #4 on: March 15, 2011, 10:56:40 PM »
Use Firebug to "see" the incoming packet - check it for xml validation and so on. If it's not being applied usually that's because of the name being wrong, or perhaps it sending something that is invalid.

cheers
Bruce