NetTalk Central

Author Topic: Parent Child Refresh  (Read 3868 times)

MyBrainIsFull

  • Full Member
  • ***
  • Posts: 134
    • View Profile
Parent Child Refresh
« on: January 12, 2015, 05:39:06 PM »
Hi all, I have a problem refreshing a parent child browse similar to Net Talk Example "Books",  where the invoice parent shows the invoice $total  -  and the child line items are totaled - so that the $total line items should be the invoice total.    See image below.

When the page opens, its ok, but if you change a child Qty, only the child total updates, I dont see how to refresh the parent browse,  the template only allows you to refresh the child browse.  But I would like to refresh the parent line item, like you can do with the child where there is an option to update just that current line.   Or failing that, refresh the whole parent browse.

To reproduce - refer to the image
change a line item qty like "Send to" From qty=2  to  qty=1
the child total drops to $208,  but the parent remains at the previous value of $357


[attachment deleted by admin]

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11251
    • View Profile
Re: Parent Child Refresh
« Reply #1 on: January 14, 2015, 06:22:39 AM »
On the parent browse (BrowseInvoices in this example)
Go to the Children Tab.
There you see the child - BrowseLineItems
Open the properties for that.

Set "On Child Updated" to "Refresh Row".
(If the parent browse also has a toal then set it to "Refresh Whole Browse".)

now come on - give me something a bit more challenging :)

cheers
Bruce

MyBrainIsFull

  • Full Member
  • ***
  • Posts: 134
    • View Profile
Re: Parent Child Refresh
« Reply #2 on: January 14, 2015, 06:33:36 AM »
Y' mean like Africa winning the cricket sometime ?

< grin >

MyBrainIsFull

  • Full Member
  • ***
  • Posts: 134
    • View Profile
Re: Parent Child Refresh
« Reply #3 on: January 14, 2015, 06:47:35 AM »
I was working on the child browse as that is where the user changes the qty purchased

I tried the following to make the parent update - any reason why it didnt ?

This is the validate of the Order Line when the Qty Ordered changes.

Validate::OrdLn:QtyOrdered  Routine

      p_web.PushEvent('parentupdated')
      do AlertChildren ! propogate event down
      p_web.PopEvent()

      p_web.PushEvent('childupdated')
      do AlertParent   ! propogate event up
      p_web.PopEvent()
         
I was expecting this to push the event to make the parent update

MyBrainIsFull

  • Full Member
  • ***
  • Posts: 134
    • View Profile
Re: Parent Child Refresh
« Reply #4 on: January 14, 2015, 06:50:25 AM »
Your help works great - Thanks

If you like, I can fix your Invoice app that has the same bug in it so you can include that in NT 8.34 examples.

Thats what a nice guy I am

K