problem with Page_Load & Row_CustomAction events
Hi,
I use both Page_Load & Row_CustomAction events with my project. I receive a warning message when I execute my custom action.
codes:
// Page Load event
function Page_Load() {
//echo "Page Load";
$this->CustomActions["addpatient"] = new cListAction("addpatient", "تائید بیمار", IsLoggedIn(), EW_ACTION_AJAX, EW_ACTION_SINGLE, "تائید و ثبت مشخصات بیمار؟", "glyphicon glyphicon-star ewIcon");
}
// Row Custom Action event
function Row_CustomAction($action, $row) {
// Return FALSE to abort
if ($action == "addpatient") { // Check action name
$rsnew = ["Approved" => "Y"]; // Array of field(s) to be updated
$result = $this->Update($rsnew); // Note: The Update() method updates the current record only
if (!$result) { // Failure
$this->setFailureMessage("Failed to update record, ID = " . $row["PatientID"]);
return FALSE; // Abort and rollback
} elseif ($this->SelectedIndex == $this->SelectedCount) { // Last row
$this->setSuccessMessage("All selected records updated.");
}
return TRUE; // Success
}
}
The confirmation message with error:
Warning: array_key_exists() expects parameter 2 to be array, null given in C:\xampp\htdocs\ptsoft\temp_patientsinfo.php on line 1243
Warning: array_key_exists() expects parameter 2 to be array, null given in C:\xampp\htdocs\ptsoft\temp_patientsinfo.php on line 1243
All selected records updated.
Codes for line 1243 :
if (array_key_exists($fldname, $this->fields) && array_key_exists($fldname, $rsold) && $this->fields[$fldname]->FldDataType <> EW_DATATYPE_BLOB) { // Ignore BLOB fields
Any idea? What's the problem?
Thanks
Mansour