I am using PowerBuilder classic 12.5
am having difficulties in inserting, editing, creating and printing reports.
i have a datawindow, dw_NewEmployee with dataobject, d_newrecord which is update-able.
- should i use the columns to insert records through the columns or i
create single line texts on the window object - is the
itemchangedevent used on columns and rows on dataobject or
on single line texts… I am having trouble figuring out how to implement validation rules.
please give me an example to validate employeeID_Number
I see that you seem confused about the datawindow usage.
Let’s try to summarize:
d_newrecord(say it is a grid) based on a sql select in your database, sayselect id_number, name from employee.id_numberandname) these objects are both to display existing data and receive user input for editing data and inserting new records.dw_newemployeewhere the content of the datawindow will be painted, you setd_newrecordas its dataobject.open()event of the window:When you want to insert new data in your table (for example with a window button “add”), in the
clicked()event of the button you calldw_newemployee.InsertRow(0)to insert at the end.The
ItemChanged()event will be triggered after one cell will be modified, you will be given the row, item (a dwobject) and new data. By choosing the returned value of the event, you can accept or reject the new data.Here is an example for a field validation in
itemchanged()event: