Advanced PowerBuilder

HomePrevious Lesson: Modifying Rows
Next Lesson: DataWindow - Data Validation

Edit Control Buffer in the DataWindow Control

Each DataWindow control has one Edit Control. It contains the current column's data. For example, the cursor is in the product_no column, then Edit Control contains the value of product_no for that row. When you press the tab key and move to the product_description column, PowerBuilder copies product_description column�s value for that row from the Primary buffer into the Edit Control.

For example, say, description for Product No: 1 is "Hard Disk". When product no:1 is retrieved from the database, both primary buffer and edit control (assuming that the cursor is in the product_description column) have the same value. You also see the same data on the screen.

Now, If you change the content of product_description, to say, "Printer", you see "Printer" on the screen and the value in the Edit Control would be "Printer". That means, the changed data is automatically reflected in the Edit Control. As long as the cursor remains in that column, the data you see on the screen and the content of the Edit Control are same; but, the value in the primary buffer has the old data, "Hard Disk".

When you press the TAB key, or go to other row, PowerBuilder validates the data in Edit Control and copies it to the Primary buffer, if the data passes the DataWindow validation. As explained in the buffers section, even before PowerBuilder copies the data from the Edit Control to the Primary buffer, it copies the row from the Primary buffer to the Original buffer, if it is the first value to be changed for that row.
HomePrevious Lesson: Modifying Rows
Next Lesson: DataWindow - Data Validation