teufel
|
Posted: 09/12/2003, 12:29 PM |
|
Simple question:
1) I first had a LABEL at the "top level of my page", i.e., not inside any forms. I set its value in the BEFORE SHOW event of the label with the value of a session variable which contains an error message. It worked beautifully:
function ErrorMessage_BeforeShow()
{
$ErrorMessage_BeforeShow = true;
//End ErrorMessage_BeforeShow
//Custom Code @38-CC060883
// -------------------------
global $ErrorMessage;
$message = CCGetSession("sErrMessage");
CCSetSession("sErrMessage","");
$ErrorMessage->SetValue($message);
// -------------------------
//End Custom Code
2) Now I just changed my LABEL to be inside my RECORD FORM, where usually the default error messages issued by CCS are printed out. And despite I checked that I still get the session variable value with no problems, the problem now is setting the label. It just doesn't work. Here is the modified code (the record form name is 'users' and the label name is 'ErrorMessage'):
function users_ErrorMessage_BeforeShow()
{
$users_ErrorMessage_BeforeShow = true;
//End users_ErrorMessage_BeforeShow
//Custom Code @38-CC060883
// -------------------------
global $users;
$message = CCGetSession("sErrMessage");
CCSetSession("sErrMessage","");
//Everything OK until now. The next line inwhich I am supposed to
//set the label value is the one that does not work.
$users->ErrorMessage->SetValue($message);
// -------------------------
//End Custom Code
Any hint of what I'm doing wrong ?????
TIA
|
|
|
DaveRexel
|
Posted: 09/12/2003, 2:10 PM |
|
::
// Setting Session to null_value in Event
// will return null_value = no Display
// try
global $users;
// an error message is shown if it exists
$message = strlen(CCGetSession("sErrMessage"))!= 0 ? CCGetSession("sErrMessage") : "";
$users->ErrorMessage->SetValue($message);
// Hope this helps
Greetings
Dave
|
|
|
|