cancel
Showing results for 
Search instead for 
Did you mean: 

IWDTextAccessor: How to get text from messagepool with parameters?

Former Member
0 Kudos

Hi,

I try to get a text from messagepool. The easy case runs fine:

IWDTextAccessor textAccessor = wdComponentAPI.getTextAccessor();

textAccessor.getText("TESTMSG");

Now I want to add a parameter to the text with key TESTMSG. I think I should call this to retrieve the text with parameter:

textAccessor.getText("TESTMSG", new Object[]{"testParameter"});

But how do I have to write the text with key TESTMSG in the messagepool in order to specify the parameter?

Regards,

Christoph

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Sorry for this question. The syntax is "some text with a "

Edited by: Christoph Schäfer on Feb 12, 2008 6:12 PM

Edited by: Christoph Schäfer on Feb 12, 2008 6:12 PM

Former Member
0 Kudos

Chris,

Define your message in the message pool something like YOUR_MESSAGEPOOL_MSG : Entry of a valid is required for proceeding with the requested service.

and pass the parameter values to the message as follows using the message manager

msgMgr.reportContextAttributeMessage(wdContext.currentContextElement(),attributeInfo,IMessageSimpleErrors.YOUR_MESSAGEPOOL_MSG, new Object[] { param1, param2 },true);

where param1 and param2 are values you want to pass to the message.

Thanks!

Surya.

Edited by: V. Surya on Feb 12, 2008 4:45 PM

Answers (1)

Answers (1)

Former Member
0 Kudos

String msg = wdComponentAPI.getTextAccessor().getText(IMessage<YourComponent>.YOUR_MESSAGE, new String[] {...});

Armin