Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Question about related data

    I have a PurchaseOrder datasource with a SupplierId field that references a Supplier data source. I create a PurchaseOrder form with a SelectItem where the user can choose the Supplier via optionDataSource. There is another FormItem on the form that needs to be disabled depending on the value in one of the Supplier fields for the selected Supplier. I can put a changedHandler on the Supplier SelectItem to check the value and disable/enable the FormItem. That changedHandler will have access to the complete Supplier record using SelectItem.getSelectedRecord().

    But when I edit an existing PurchaseOrder using DynamicForm.editRecord() I also need to disable the FormItem when the form is first rendered so I need access to the related Supplier record. The Supplier SelectItem is loaded asynchronously. When can I safely use SelectItem.getSelectedRecord() to get the related Supplier record. If I add a DataArrivedHandler on the SelectItem can I expect getSelectedRecord() to give me the complete Supplier record based on the SupplierID in the record being edited once the DataArrived event is fired?

    #2
    Subscribe to the issue.

    Comment

    Working...
    X