I have a VL Dialog that is a list of items on an order.
When the dialog is initially displayed for a new order, there are no detail records.
I have an "Add item" button that calls the MTHROUTINE "AddNewDetail" to add new detail records to the order.
When the add detail record is complete, it triggers the signal event "ItemSaved".
In the MTHROUTINE, I have an eventroutine handling specific for the "ItemSaved" which clears the order list, prints out to the web console.log, and then calls the routine to refresh the order list and show the dialog.
Here is my issue:
When you first call the dialog with a new order, and add initial item(s), the dialog does not refresh? The write to the console.log doesn't happen? The detail items are correctly added to the order in the file, just the Event Handling of "ItemSaved" does not take place?
If you get out of the dialog, and then go back into the dialog, the item details that were added, do show correctly.
Now, upon going back into the dialog, if you add another new detail item, the dialog refreshes, the console.log gets written out, all as expected in the event handling of "ItemSaved".
Why does this not work, or respond on the initial use, but works fine on subsequence uses?
Code: Select all
* Add New Detail line record
MTHROUTINE Name(AddNewDetail)
* Call to Add New Line Detail - prompting dialog, item cat, then item.
DEFINE_COM Class(#P1MAddOrderDetail_Dialog) Name(#AddDetail)
#AddDetail.Refresh( #CENO #CELID #ORDN )
EVTROUTINE Handling(#AddDetail.Closed)
CLR_LIST Named(#ListDtl)
#COM_OWNER.ShowDetails( #CENO #CELID #ORDN #ORDNAM )
ENDROUTINE
EVTROUTINE Handling(#AddDetail.ItemSaved)
CLR_LIST Named(#ListDtl)
* Console - debug
#sys_web.Console.Log( ('LINE-#443 AddNewDetail: ' + ' - ' + #) )
#COM_OWNER.ShowDetails( #CENO #CELID #ORDN #ORDNAM )
* #SYS_WEB.Alert Caption('Item Added to Order.')
#Alert.Caption := 'Item Added to Order.'
#Alert.ShowAlert
ENDROUTINE
ENDROUTINE