cancel
Showing results for 
Search instead for 
Did you mean: 

Message displaying in only one message area

Former Member
0 Kudos

Hi,

I have two group containers and my requirement is to display a message on selection of one entry in second Group container.

But any message, which is supposed to display in Message Area1, it is displaying only in the Message Area as below :

I have written the following code :

wdComponentAPI.getMessageManager().

reportException("This service will trigger an approval workflow to your business line and functional GM." +

  "Please ensure that you submit enough justification details",true);

On selection of Select required services this error message will trigger.

Any suggestions will be appreciated!

Best Regards,
KC

Accepted Solutions (0)

Answers (1)

Answers (1)

Sharathmg
Active Contributor
0 Kudos

Hello KC,

From my experience, the messages cannot be split between two message area.

Only one message area can be placed and all messages will be pushed into that message area.

Hence, I try to use the message field highlighting and places the errors either on top or middle.

Regards,

Sharath

Former Member
0 Kudos

Hi Sharath,

Thank you for your Reply!

It gave me a chance to explore any other alternative things to use.

I think I can use Text View instead of Message Area.

Can you please provide any sample code or way to use the Text View to display my Warning message into Text View?

Any suggestions will be appreciated!

Best Regards,

KC

Sharathmg
Active Contributor
0 Kudos

Hello Krishna,

You can use Text View and assign a context variable to the text view.

In your code, whichever message you would like to displayed, populate the context variable(which is attached to text view) in the code.

So, when the page is loaded, the text view will display the message assigned in your code.

However, you may have to use the background/color options of the text view to highlight the message.

Meanwhile, retain one message area element to make use of the standard message handling framework of Web Dynpro.

Regards,

Sharath

Former Member
0 Kudos

Hi Sharath,

Thanks for your replay!

I have taken a Text View and mapped it to a context vairable as shown below :

Ex : Once the Values are selected from Drop down , we will have to check if that value is “ORANGE” or not.   

If ServiceList value = ORANGE.

       Then display the text in the Text View

endif.

I have tried with the below code but no luck :

 

String STRING1 = wdContext.currentContextElement().getServiceList();

if(wdContext.currentContextElement().getServiceList().equalsIgnoreCase("PRINTER"))

{

Message " You have selected ORANGE".

}

This message should be populated in the Text View created.

Can you kindly correct me with the code if I have written it incorrectly plz?

Any suggestions will be appreciated!

Best Regards,

KC

Former Member
0 Kudos

Hi,

Set the message to the text view attribute ( in your case I think, the attribute name is "String1").

Check the condition, if the user has selected orange then set the attribute"String1" as " orange" else set some other value.

ex:

if(servicelist == "orange")

{

wdcontext.currentnodenameelement.setstring1("orange");

}else

{

set some other message;

}

Thanks!

Swarnaprakash