1

I am working within a Jaguar 5.4 environment using PowerBuilder 11.2 9097. I have a php script within I have a javascript for the event beforeItemChanged. I am calculating an end date (datetime with edit format of dd-mmm-yyyy) from a start date and number of months to add. The event fires after entering the number of months. I am able to calculate the new end date. I attempt to change the end date within the datawindow using dw.SetItem(row, column, value) with the newly calculated end date but the set item fails with the return code -1. I have tried the following formats: mm/dd/yyyy, mm-dd-yyyy, dd/mm/yyyy, dd-mm-yyyy, dd-mmm-yyyy (edit format within dw), new Date(), string variations of date listed. I even tried to just enter a valid date but every variation fails.

I am able to set other field and data types but not able to set datetime field.

Has anyone succeeded in set a date on a HTML datawindow using SetItem within the beforeItemChange event. If so, can you provide an example of the setitem statement.

TIA Anthony

Anthony S
  • 65
  • 11

1 Answers1

1

As pointed out by a coworker, to resolve this issue you will need to code the following:

dw_1.setRow(rownum);

dw_1.setColumn(col name/number);

dw_1.setText(date value);

dw_1.acceptText();

hth

Anthony

Anthony S
  • 65
  • 11