KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Getting a subform to redraw properly with computed values
PRODUCT: 4D | VERSION: 6.5 | PLATFORM: Mac & Win
Published On: August 17, 2001

If you have an included layout within an input form (e.g. an invoice with line items) and 4D is not refreshing a computed variable, you can trigger a redraw from the Object Method that is programatically changing the value on the subform:

vLineTotal:=ItemPrice*Quantity ` for example, a sales order
bNeedRedraw:=True

In the Form Method for the master form (the outer form), place the following test:

C_BOOLEAN(bNeedRedraw)
If (bNeedRedraw=True)
 REDRAW([SaleLineItems])
  bNeedRedraw:=False
End If


This way, whenever a change is triggered it will set a flag (bNeedRedraw) that will be caught in the outer form's method and make the needed call to REDRAW (note that calling REDRAW from within the subform has no effect).