cancel
Showing results for 
Search instead for 
Did you mean: 

Reusing Messages (Message Pool)

Former Member
0 Kudos

Hi

I am making some experiments with message pool.

Is it possible to reuse messages? Is it related with components reuse?

[]

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Ronaldo,

yes, if you have added the component usage of Component A to component B the message pool (IMessageXXX interface) of A is known by B, you can access it by

wdComponentAPI.getMessageManager().reportMessage(IMessageA.ERROR_MESSAGE, null, false);

for example.

<b>Correction</b>:

Sorry i've forgotten temporarily:

This is not possible this way, since the calling component cannot access the message texts in the resource bundles of the defining component. You must get access to the IWDMessageManager instance of the component which has defined the message (maybe by exposing the message manager of A in a method getExtMessageManager() of the interface controller of A).

So the call would look like

wdThis.wdGetAInterface().getExtMessageManager().
  reportMessage(IMessageA.ERROR_MESSAGE, null, false);

Hope that helps.

Regards

Stefan