NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: Alberto on December 06, 2009, 05:42:49 AM

Title: NT5 and Message Class
Post by: Alberto on December 06, 2009, 05:42:49 AM
I´m changing the Message Class deriving the Message method like:

p_web.Message PROCEDURE(String p_div,<String p_message>,<String p_class>,Long p_Send=0)

ReturnValue          ANY

  CODE
  p_class='MyMessageClass'   !<<<<<<<<<< line added
  ! Parent Call
  ReturnValue = PARENT.Message(p_div,p_message,p_class,p_Send)


It compiles and work ok in NT4, but its not working in NT5, with firebug the NT4 line looks like:

<div class="MyMessageClass" id="alert_div">Login Failed. Try Again.</div>

and with NT5:

<div class="" id="alert_div">Login Failed. Try Again.</div>


Any other place wher I can change the message class?

Thanks
Alberto


Title: Re: NT5 and Message Class
Post by: Bruce on December 06, 2009, 09:17:55 PM
Hi Alberto,

I'll need to test - but a quick look at the code shows no real change on my side that should affect you.

However I notice, you're assigning a value to a string parameter - that's not a good idea because you don't know how
long the string parameter is. Rather call the parent call directly with the new parameter, and Return before the generated call.  ie

p_web.Message PROCEDURE(String p_div,<String p_message>,<String p_class>,Long p_Send=0)

ReturnValue          ANY

  CODE
  ReturnValue = PARENT.Message(p_div,'MyMessageClass',p_class,p_Send)
  Return ReturnValue
  ! Parent Call


Cheers
Bruce
Title: Re: NT5 and Message Class
Post by: Alberto on December 07, 2009, 02:58:07 AM
Hi Bruce,

You are right, Its working now.

Thanks
Alberto