Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE » How To » Display a message in an ADD2 transaction
Display a message in an ADD2 transaction [message #2110] Sat, 06 June 2009 12:41 Go to next message
gpatti is currently offline  gpatti
Messages: 283
Registered: August 2008
Senior Member
I want to display a message at the start of an ADD2 transaction under certain circumstances.

I've tried setting $this->messages[] in both the initialise() and getinitialData() methods but the message is not displayed.

Do I need to do this in another method?
Re: Display a message in an ADD2 transaction [message #2111 is a reply to message #2110] Sat, 06 June 2009 17:43 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2368
Registered: April 2006
Location: Surrey, UK
Senior Member
What version of Radicore are you using? The latest version definitely contains code to extract messages just before the screen is displayed.

Re: Display a message in an ADD2 transaction [message #2112 is a reply to message #2110] Sat, 06 June 2009 18:32 Go to previous messageGo to next message
gpatti is currently offline  gpatti
Messages: 283
Registered: August 2008
Senior Member
I'm definitely using 1.48 now. Messages seem to work ok in the other places I'm using them but not in this case.
Re: Display a message in an ADD2 transaction [message #2113 is a reply to message #2112] Sat, 06 June 2009 19:14 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2368
Registered: April 2006
Location: Surrey, UK
Senior Member
I have just done a test by creating a message in the _cm_getInitialData() method, and it is definitely appearing. Can you step through with your debugger to see what is happening? Any messages should be extracted at line 170.

Re: Display a message in an ADD2 transaction [message #2114 is a reply to message #2110] Mon, 08 June 2009 05:22 Go to previous messageGo to next message
gpatti is currently offline  gpatti
Messages: 283
Registered: August 2008
Senior Member
Think I have found the problem...

When I was reading the documentation I noted that you can use $messages (string) for a single message and $messages[] (array) for multiple messages. However, originally I forgot to use $this-> so of course it didn't work when I tried either the string or the array structures.

When I realised my mistake not using $this-> I only used the string structure $this->messages, and this still doesn't work.
Using the array structure $this->messages[] does work.
Re: Display a message in an ADD2 transaction [message #2115 is a reply to message #2114] Mon, 08 June 2009 06:12 Go to previous message
AJM is currently offline  AJM
Messages: 2368
Registered: April 2006
Location: Surrey, UK
Senior Member
That's my mistake Embarassed

I shall change all my page controllers to use $dbobject->getMessages() instead of $dbobject->messages as this will allow $this->messages to be either a string or an array.


Previous Topic: Restrict the input size of a multi-line text box
Next Topic: System Shutdown Times
Goto Forum:
  


Current Time: Sun Nov 24 04:25:06 EST 2024

Total time taken to generate the page: 0.01127 seconds