Skip to Content
author's profile photo Former Member
Former Member

Error messages in MVC

Hi,

In the do_handle_event of one of my subcontollers I insert an error message if a condition was not met.

...

...

ELSE.

me->messages->add_message(

condition = 'wa_numreturn'

message = 'The number entered does not exist.'

severity = me->messages->CO_SEVERITY_ERROR ).

ENDIF.

I have included the following code to display the error in the view called by the above subcontroller:

<htmlb:textView text = "<%= page->messages->assert_message( 'wa_numreturn' )%>"

textColor = "red"

wrapping = "FALSE" />

However, the message is not displayed even though the code in the do_handle_event gets executed.

Can the "condition" for messages be any text or should it be a attribute in the controller & view?

Could someone please let me know why the message is not passed from the controller to the view? Do I need to pass it explicitly?

Thanks.

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Feb 13, 2005 at 01:34 PM

    It was a silly mistake. I was trying to display the message outside my gridlayout. I have placed it within and it works fine now.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.