cancel
Showing results for 
Search instead for 
Did you mean: 

how to display a text message from the message pool

Former Member
0 Kudos

Hi,

i have created some text messages in the message pool.

i have an text view UI element, in the property of that UI element i have mapped its text to an value node attribute.

now i want that text message from message pool to be displayed as the UI element's text.

help me out with code

Regards,

Suresh

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi,

You should use the TextAccessor APIs for this. Let's say the message key is TXT_MSG. So you can access the message string as follows:

String msgTxt = wdComponentAPI.getTextAccessor().getText("TXT_MSG");
//bind msgTxt to context...

Regards,

Satyajit.

Former Member
0 Kudos

Hi satyajit,

may i know wats that String msgtext?

Former Member
0 Kudos

Hi,

It's just a String variable. You can use any other name.

Regards,

Satyajit.

Former Member
0 Kudos

hi satyajit,

its fine, but may i knoe where you are mapping this text message to that textview UI element's text property.

could you please help me out with the complete code.

Former Member
0 Kudos

Hi,

From your first post: <i>i have mapped its text to an value node attribute</i>. Let's say you have called this attribute as "<i>Text</i>" and it's type is String. So you can bind like this:

wdContext.currentContextElement().setText(wdComponentAPI.getTextAccessor().getText("TXT_MSG"));

Regards,

Satyajit.

Former Member
0 Kudos

Hi Satyajit,

Its working..

Thanks

Regards,

Suresh

Former Member
0 Kudos

IWDMessageManager <message manager name> = wdThis.wdGetAPI().getComponent().getMessageManager();

if you have any parameters then write them:

Object[] <object name> = {new Integer(variable1),new Integer(variable2),new String(variable3)};

<message manager name>.reportMessage(IMessage<project name>.< key of the message>,<object name>,true);

This "true" is used when all steps in navigation are to be cancelled on displaying the error message.

Note write parameter in message Pool using .

Regards,

Vito

Former Member
0 Kudos

Hi Sureshkumar,

The message will be displayed in the message area only and not in any of the UI element.

wdComponentAPI.getMessageManager().reportMessage(IMessage<componentname>.<Message Key>,null,true);

This will display message at the end of your screen if you are not having message area UI element in your screen and if you are having one then it will display it wherever your message area is placed on the screen.

Regards,

Murtuza

Former Member
0 Kudos

Hi,

Please go thru this link.......could be of use to you........

http://help.sap.com/saphelp_nw70/helpdata/en/ec/1415b06e76584ca6b92fe565206fed/frameset.htm

Regards,

Padmalatha.K

Message was edited by:

Armin Reichert

Former Member
0 Kudos

messageMgr.reportMessage(IMessage<compname>.msgname, new Object[], false);