cancel
Showing results for 
Search instead for 
Did you mean: 

Change Color of Message

Former Member
0 Kudos

Hi Experts,

We have a scenario to show error and success messages in the WD application.

However, we have to not only show the 'Green Icon' for success message, but also change the entire message text to green color (for Success message), and red (for error message).

Not sure if this is possible in WD.

Please help/suggest any code/classes.

thanks!

parteek

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Parteek,

                 Instead of displaying standard messages you can actually create your own messages with icons where you can  change color of the text and as well as fix icon for a particular message based on type. Just do R&D and apply simple logic you will definitely get a solution.

Kind regards,

Dineshwar Singh Eswar

Former Member
0 Kudos

Hi Prateek,

The other option is to create a context node for error messages with 3 attributes i.e. Icon , Message and Semantic Color.

Take a table UI element and select the above node as DataSource.

Write your own method to fill error messages with icon and color into above node.

make the table invisible if there are no messages...

It'll look something like below screenshots...

Regards,

Rohit

Shivesh
Advisor
Advisor
0 Kudos

HI Rohit/Parteek,

    Use row repeater, tht will go with ur requirement.

Regard's,

Shivesh Ranjan.

amy_king
Active Contributor
0 Kudos

Hi Parteek,

With the standard MessageArea and message manager, it isn't possible to change the color of the message text itself. SAP probably didn't include this as an option because the message text can optionally be a hyperlink to the view's corresponding context element or attribute, so any color would be overridden anyway by the hyperlink color.

Cheers,

Amy

Former Member
0 Kudos

Thanks amy for your response. However, my client has claimed that this is possible and that he has seen this working with someone's portal so, we've to do it no matter how.

In case you find anything fruitful, please share the same.

thanks,

regards

Shivesh
Advisor
Advisor
0 Kudos

Hi Parteek,

    Then u create a text view, with marked as Positive(Green color) or select color as per ur requirement. Hide/Display based on your condition. And, at run time, bind the desired text.

    Even at run time, u can change the color. based on ur condition.

Regard's,

Shivesh Ranjan.

amy_king
Active Contributor
0 Kudos

Hi Parteek,

In that case, you can always build a custom message solution. Rohit's suggestion seems a good alternative to using the standard MessageArea.

Cheers,

Amy

Shivesh
Advisor
Advisor
0 Kudos

Hi Amy,

     Ya, I agree to tht. And, for avoiding frames & table sort of thing. We can go with Row-Repeater. Coz, it also work as Table internally. But, will be visible like rows. So, we will having a standard look & feel  like standard messages, with colour change.

Regard's,

Shivesh Ranjan.

cfb
Participant
0 Kudos

Hello Shivesh,

is it possible to elaborate a little bit further how this might be accomplished? I did a search for Row Repeater and came up with this:  http://wiki.sdn.sap.com/wiki/display/WDABAP/steps+to+create+row+repeater+ui+element

But I'm not quite sure how to get the Messagearea in there. I've tried to make a Message_Area a child of the Row_Repeater but the results are the same.

Any help would be appreciated.

(and sorry for resurrecting this thread, but search didn't turn up a more appropriate topic)

Shivesh
Advisor
Advisor
0 Kudos

HI Chris,

    If you are using row repeater or table for message purpose. Then, you should not use Message class for throwing the messages. What you need to do, is use this UI element and hide it. Whenever you want to display messages with change color, etc. Then unhide those UI.

Regard's,

Shivesh Ranjan.

Former Member
0 Kudos

Hi,

Are you using the standard message class to show the messages?

If not, and you are using a UI element for the message, you can use text view UI element where you can easily get the icon and text color.

Thanks,

Pris.

Former Member
0 Kudos

Hi Pris,

I am using the standard approach to generate a message using message manager. I am using

REPORT_SUCCESS - for success message

REPORT_ERROR_MESSAGE - for error message

in these methods, I get the icon, but the text color is not changing.

Please help.

thanks,

parteek