cancel
Showing results for 
Search instead for 
Did you mean: 

MessageArea in popup

Former Member
0 Kudos

Hi everyone,

I have already gone through few postings regarding this topic.Still i have problem with my project.

I have one project and several applications en components under it.so i have only one DC and not several Dc's.

I have defined MessageArea UIElement in all my views and bind the property enable to readonly type boolean.(Say GridMsg and PopUpMsg)

In the GridView i am setting the GridMsg attribute to true in DoInit,DoModify methods.Same way popupmsg also set to true in its view.

When i press a go button to go to popup,i set the Gridmsg to false.

In the popup when error is occured,it is still showing in the GridView and not as i expected in popupview.

Is this behaviour because i am using one project and not different Dc's or am i doing something wrong.I am also not sure if i can set the readonly attribute value to false.Please advice me on this.

thanks

regards

Senthivel

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Baskaran,

Probably you can try Visibility instead of Enabled. Attribute type must be com.sap.ide.webdynpro.uielementdefinitions.Visibility (in context designer), set WDVisibility.NONE or WDVisibility.BLANK in code instead of false / true respectively

Valery Silaev

SaM Solutions

http://www.sam-solutions.net

Former Member
0 Kudos

Hi,

Let me tell you what worked for my case.

I had several message areas across several views spread in several DCs.

Suddenly the client requirements changed, so I needed to make a popup containing a MessageArea, which appeared to be a problem because messages sent from inside the popup did not appear in the new (popup's) area, but in the area of the main window.

Despite I liked Baskaran's proposal the project was at its end and I already had too many views to change and too little time. Therefore I tried to find a lazier solution.

So, I bound all previously existing MessageAreas' "enabled" property to a shared context attribute. This made possible displaying messages inside the popup.

Unfortunatelly I have noticed an unwanted side effect - when the popup is not active (in other words all other message areas are enabled) all messages went not to a message area but to the bottom of the screen.

Crap!

The solution?

Read again the IWDMessageArea javadoc.

Then made the shared context attribute "read only" and everything went okay.

Now messages are displayed inside MessageAreas as before, and not on the bottom of screen. When the popup is active (other message areas are disabled) all messages show inside the popup. When the popup is closed and other MessageAres "enabled" is back to "true" - everything is as supposed to be.

Enjoy!

Former Member
0 Kudos

Rumen,

Funny, indeed in JavaDoc we can read:

<i>

  1. it's enabled property is neither set to false nor bound, except to a read-only context attribute of value true.

  2. it's visibility is neither set to NONE or BLANK nor bound, except to a read-only context attribute of value VISIBLE.</i>

So you say it works as expected only if property IWDMessageArea.Enabled is bound to read-only boolean attribute???

VS

Former Member
0 Kudos

Hi Senthivel,

Messages are shown in the first Message Area loaded in the memory irrespective of that you set the enable property to true and false depending on the active view.

Try this.

Since you have one project, create a value attribute "MessageAreaViewName" of type String in Component Controller. Do a context mapping of this parameter to all your View Controllers.

Now first delete all the Message Areas from all the views. Declare a Transparent Container name "TC" in all the views. In the wdModifyView of all the view do something like this.

view.resetView();

if ("<Active View Name>".equalsIgnoreCase(wdContext.currentContextElement().getMessageAreaViewName())){

IWDTransparentContainer tc = (IWDTransparentContainer)view.getElement("TC");

IWDMessageArea messageArea = (IWDMessageArea)view.createElement(IWDMessageArea.class, "MessageArea");

tc.addChild(messageArea);

}

Remember to set the MessageAreaViewName each time you navigate to another view.

This will ensure that you have a MessageArea only in the active view.

Regards,

Shubham