Unable to set JTGroubox caption

Post Reply
Dmilpsu
Posts: 28
Joined: Sun Apr 17, 2016 7:14 pm

Unable to set JTGroubox caption

Post by Dmilpsu » Wed May 25, 2016 3:52 pm

I have a lable which captures a name from the database. I then code on the before show to set the groupbox caption to the label caption. I get a null value. I have tried setcaption, getcaption, caption itself to no avail. The label recieves the value and displays it correctly. I am at a lost. Guess I am not sure at what point in teh process the label gets it's value from the database. I seem to be asigning it too soon.

function PgSClockinBeforeShow($sender, $params)
{
if ($_GET) {
$id = $_GET['id'];
$myFilter = "idStudent = " . $id;
$this->tbstudent1->Filter = $myFilter;
$this->tbstudent1->close();
$this->tbstudent1->open();
}
else {
$this->JTGroupBox1->Caption = "Unknown";
}

}
function JTGroupBox1BeforeShow($sender, $params)
{
$this->JTGroupBox1->setCaption = $this->JTLabel2->Caption;
}
}

jomitech
Site Admin
Posts: 1967
Joined: Wed Oct 08, 2008 12:23 am

Re: Unable to set JTGroubox caption

Post by jomitech » Mon May 30, 2016 10:46 pm

The label gets the caption when it's rendered, but it does not store that value into its Caption property. It's just stored in a temporary variable for the render.

You will need to pull the value yourself from the database and update the JTGroupBox caption manually.
Jon

Post Reply