cancel
Showing results for 
Search instead for 
Did you mean: 

How to send messages to differents MessageArea

Former Member
0 Kudos

Hi,

I have a view which have two MessageAreas, MessageArea1 and MessageArea2, for example.

I'd like to know how to send message to one specific MessageArea.

Can anybody help me on this issue?

Thanks in advance,

Celso.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Celso,

Just make other 2 message areas invisible

VS

Former Member
0 Kudos

Hi Valery!

Following the steps I did:

1. Created two value attributes to control the visibility of the messageareas (the type of the attributes is com.sap.ide.webdynpro.uielementdefinitions.Visibility)

- FistMessageAreaVisibility

- SecondMessageAreaVisibility

2. Set the visible property of the messageareas:

- FistMessageArea

Property Value

visible FistMessageAreaVisibility

- SecondMessageArea

Property Value

visible SecondMessageAreaVisibility

3. In the wdDoInit() method, both attributes were set to WDVisibility.NONE:

- wdContext.currentContextElement().setFistMessageAreaVisibility(WDVisibility.NONE);

- wdContext.currentContextElement().setSecondMessageAreaVisibility(WDVisibility.NONE);

4. Create a method one to show a message in the FirstMessageArea (EventOne):

wdContext.currentContextElement().setFirstMessageAreaVisibility(WDVisibility.VISIBLE);

wdContext.currentContextElement().setSecondMessageAreaVisibility(WDVisibility.NONE);

IWDMessageManager msgManager = wdComponentAPI.getMessageManager();

msgManager.reportMessage(IMessageTestComponent.FIRST_MESSAGE_AREA, null, true);

5. Create a method to show a message in the SecondMessageArea (EventTwo):

wdContext.currentContextElement().setFirstMessageAreaVisibility(WDVisibility.NONE);

wdContext.currentContextElement().setSecondMessageAreaVisibility(WDVisibility.VISIBLE);

IWDMessageManager msgManager = wdComponentAPI.getMessageManager();

msgManager.reportMessage(IMessageTestComponent.SECOND_MESSAGE_AREA, null, true);

EventOne is working fine, but event two is not. It's showing the message in the SecondMessageArea

Am I missing something, Valery?

Thanks in advance.

Celso.

Former Member
0 Kudos

Celso,

Could you revisit your reply?

Because of:

<i>EventOne is working fine, but event two is not. <b>It's showing the message in the SecondMessageArea</b></i>

This is exactly what second method is suposed to do -- you are left visible <b>second message area</b>!

VS

Former Member
0 Kudos

Hi Valery,

Sorry about the mistake.

EventOne is working fine. It's showing messages in the FirstMessageArea.

EventoTwo is not working. It's also showing messages in the FirstMessageArea.

Please Help.

Thanks in advance,

Celso

Former Member
0 Kudos

Hi Valery,

I’ve just noticed that <b>both events</b> (EventOne and EventTwo) <b>are not working</b>.

Following the structure of the view I created to test this issue

RootUIElementContainer
|--- TransparentContainer1
|    |--- FirstMessageArea     
|--- TransparentContainer2
|    |--- Button1
|    |--- Button2
|--- TransparentContainer3
|    |--- SecondMessageArea
|--- Label1

EventOne refers to the action of Button1 and EventTwo to Button2. That is, if I click on Button1, a message should be displayed in FirstMessageArea and if I click on Button2, in SecondMessageArea. <b>But all messages are being shown below Label1, whatever button I click</b>.

Am I missing something?

I'd appriciate if you could help me.

Thanks in advance.

Celso.

Former Member
0 Kudos

Celso,

Seems to be a WD bug: I've created test project, but MessageArea-s does not reflect Visibility settings correctly.

So instead use just one message are, in action update some context attribute to flag that message area should be moved and in wdDoModifyView remove messageArea and then insert it at necessary position.

P.S. You may send me e-mail to <b>vsilaev AT gmail DOT com</b> and I'll send you sample project.

Valery Silaev

EPAM Systems

http://www.NetWeaverTeam.com

Former Member
0 Kudos

Hi,

Yes, Visibility does not work.; In case of more than one component.. the first instance .. created.. would be the valid one..

<i>The MessageArea UI element represents a placeholder that specifies where messages, such as error messages or warnings, should appear in the view.

If there is a suitable MessageArea instance, all messages appear in this instance. Otherwise, the messages appear in a separate window that is similar to a status bar and appears at the bottom of the screen. You can use a MessageArea instance when it belongs to the layout of the associated view.

You cannot set the enabled property to the value false and can only bind this property to a read-only context attribute of type boolean with the value true.

You cannot set the visible property to the values none or blank and can only bind this property to a read-only context attribute of type com.sap.ide.webdynpro.uielementdefinitions.Visibility with the value “VISIBLE“.

If there is more than one suitable IWDMessageArea instance, the first instance created is used

Under certain circumstances, the Web Dynpro Framework changes the position specification of the MessageArea UI elements, if other targets have priority, for example, portal mechanisms for displaying error messages.

</i>

Regards

Bharathwaj

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

is this an official bug and/or is there any solution for this?

Thanks,

Bjoern

Former Member
0 Kudos

Hi Celso,

try these two documents...you can do yourself.

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/a simple input form with message and error service support.pdf

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/internat... of web dynpro applications.pdf

/Raj.