Cannot get a value in Page_load event (v2023)

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
bern_a3168
User
Posts: 53

Cannot get a value in Page_load event (v2023)

Post by bern_a3168 »

Hello,

I want to get a vaule to check a condition in Edit / Page_load event as the ocde below but it always shown as blank. the field got data and not sure if I missed anything.

// Page Load event
function Page_Load()
{
    //Log("Page Load");
    global $Page;
    $Page->setMessage("Status value = ".$this->process_status->CurrentValue);  //*** it shown nothing

    If ($this->process_status->CurrentValue !=1) 
    {
        $Page->setMessage("Status value = ".$this->process_status->CurrentValue); //*** it shown nothing
        $this->informed_leaver->ReadOnly = TRUE;
        $this->process_status->ReadOnly = TRUE;
        $this->reminder_sent->ReadOnly = TRUE;
        $this->mdp_sponsor->ReadOnly = TRUE;
        $this->office_code->ReadOnly = TRUE;
        $this->hrid->ReadOnly = TRUE;
        $this->full_name->ReadOnly = TRUE;
        $this->e_mail->ReadOnly = TRUE;
        $this->employee_type->ReadOnly = TRUE;
        $this->biz_title->ReadOnly = TRUE;
    }

}

arbei
User
Posts: 9384

Post by arbei »

  1. You better use Page_Render instead. (Page_Load is too early, the data is not loaded yet.)
  2. You can replace $Page by $this.

bern_a3168
User
Posts: 53

Post by bern_a3168 »

ah ... it works pefectly.
thanks so much!!


Post Reply