China Computer News 2000 No. 92
DataWindow dynamometer change DROPDOWNDW value
Sun Yak
DataWindow in PowerBuilder is very powerful, especially its DropDowndw editing style, but also provides a guarantee for the consistency of relevant data. In practical applications, you often need to display a specific content in a field with a DropDowndw style. For example, in a certain application, the value of the department employee field must be dynamically changed according to the changed department number (or department name). To achieve this requirement, the DataWindowChild object can be used. The DataWindowChild object can be a nested report, or a DataWindow object with DropDowndataWindow editing style. For example, a DataWindow object with a DropDowndataWindow editing style column is a DataWindowChild object. The DataWindowChild object is used to access DataWindow objects outside the DataWindow feature, and because it needs to be stored and automatically instantiated, it inherits the StruCTure object from the system. The following is a brief description with a small instance. There is a DataWindow for dw_1, which has a "Name" field with DROPDOWNDATAWINDOW editing style, with the DataWindow named DW_Who, which contains a field "DEPTID" dynamic update Query conditions. The code is as follows: DataWindowChild DWC Integer Rtncode File: // Has a DROPDOWNDW editing style, the value of the dominant change field name RTNCode = dw_1.getchild ("Name", DWC) if q = -1 Then MessageBox ("Error Tip", " NOT A DATAWINDOWCHILD ") // Establish connection connecture limited SQLCA; // Settings the Subride Data Window of the Object DWC.SetTransObject (SQLCA) File: // Subproof Search value dwc.Retrieve (20) File: // Let Name Columns only displays the employee name of the department name of 20 to set the main data window of the primary data window and retrieve dw_1.settransObject (SQLCA) dw_1.Retrieve () The above code is debugged in PB7 ORACLE8.