CF V4 dynamic Add System Message

bighen 05 Apr, 2012
Hi,
The event Add System Message is static now.

Is there any way to hack it and display dynamic message?
For example
"Data saved. Reported by {operator}"
or
"Report no {report_no} saved."

Or I missed some way to use it?

Regards
Henryk
GreyHead 05 Apr, 2012
Hi Henryk,

Not with the current version of the action - I just looked at the code. But you can do it with a Custom Code action. Add code like this
<?php
$mainframe =& JFactory::getApplication();
$message = "Data saved. Reported by {$form->data['operator']}";
$mainframe->enqueuemessage($message);
?>


Bob
bighen 05 Apr, 2012
Thanks Bob.
That's what I need.
I still miss some knowledge about J! API..

Henryk
momentis 10 Apr, 2012
Similar to this, what if I want to display a system message if the SUBMIT button is pressed, but not display one of the BACK button is used? So, if the user saves changes by hitting SUBMIT, a message stating that the changes were saved will appear. If they hit BACK, they are redirected to the last page without a system message.
GreyHead 10 Apr, 2012
Hi Rick,

I think that the submit and back buttons have different values so you can check which one was clicked.

Bob
This topic is locked and no more replies can be posted.