cancel
Showing results for 
Search instead for 
Did you mean: 

How to display Dynamic Message in Message Pool.

dhruv_shah3
Active Contributor
0 Kudos

HI All,

I want to display the Error Message in Message Pool Dynamically.

By creating only one Message in Message Pool of Type Error.

I.E If user leaves the First Name and Last Name Field Blank then

Error Message Should appear as:

Please Enter First Name.

Please Enter Last Name.

How could i achieve this.....

Regards,

Dhruv Shah

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi dhruv,

In the message pool create

Message text : Please enter to submit. message Type:Error messaky: Missinginput In the it will take the object which we are passing.

Regards,

karthik.

dhruv_shah3
Active Contributor
0 Kudos

Hi,

I had done this earlier but i had faced error .....

ANyways Thank You.

Former Member
0 Kudos

Hi,

Can u tell me clearly.With the error.

Karthik

Answers (3)

Answers (3)

former_member214651
Active Contributor
0 Kudos

Hi Dhruv,

In the Message Pool create a new Message of Type error and the Text Please enter the .

And on the action of Your Submit button write the following code :-

String strFirstName = wdContext.currentContextElement().getFirstName();

IWDMessageManager msgMgr = WdComponentAPI().getMessageManager();

IWDAttributeInfo <ObjectName> = this.wdContext.getNodeInfo.getAttribute("FirstNameField");

if( strFirstName == null || strFirstName.length() == 0)

{

msgMgr.reportContextAttributeMessage(wdContext.currentContextElement,<ObjectName>,IMessage<componentName>.<MessageKey>,new Object[] {"First Name"},true);

}

former_member214651
Active Contributor
0 Kudos

Hi Dhruv,

In the Message Pool create a new Message of Type <b>error</b> and the Text <b>Please enter the </b>.

And on the action of Your Submit button write the following code :-

IWDMessageManager msgMgr = WdComponentAPI().getMessageManager();

IWDAttributeInfo <ObjectName> = this.wdContext.getNodeInfo.getAttribute("FirstNameField");

if(<ObjectName> == null)

{

msgMgr.reportContextAttributeMessage(wdContext.currentContextElement,<ObjectName>,IMessage<componentName>.<MessageKey>,new Object[] {"First Name"},true);

}

Former Member
0 Kudos

Hi,

try this.

define message as Please Enter in Message Pool

and

Use following code

a=wdContext.currentContextElement().get<FName>();

b= wdContext.currentContextElement().get<LName>();

MessageManager msgMgr = (MessageManager)wdThis.wdGetAPI().getComponent().getMessageManager();

if(a==null)

Object[] obj ={new String(a)};

else if(b==null)

Object[] obj ={new String(b)};

msgMgr.reportMessage(<component>.<key>, obj, true);

Regards

LakshmiNarayna