Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating a DataWindow Column 2

Status
Not open for further replies.

Negator

Programmer
Oct 4, 2003
33
RU
Hello!!
Sorry for my simple question.

I have an editable column (a field for a date) on my DataWindow. When I edit it, it's value counts as it's old value, even if I entered another, until the "edit"-cursor stays on the field.

What code should be executed to update the value?

Thank you!
 
The contents of the Edit-control are not flushed into the underlying column until there is a column-focus-change or a call to AcceptText(). In your case (since you want the edit-control's value to be considered), simply place a call to dw.AcceptText() in the ItemChanged! event.

That would flush the underlying column and any computed-fields based on this column should automatically be updated, too.

---
PowerObject!
-----------------------------------------
PowerBuilder / PFC Developers' Group
 
The ItemChanged event only fires when there is a column-focus-change, the user presses enter key, or AcceptText() has been called. You only have to call AcceptText() before you use the value the user entered. For example, at the beginnig of the Clicked event of a commandbutton that uses the column value. If you want to read the value exactly when the user presses any key, then call AcceptText inside the EditChanged event of the DW, but I don't suggest it, 'cause the user might not have entered the right value yet.

Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top