Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

problem in error message display

public void messid( )

{

//@@begin messid()

msg = wdComponentAPI.getComponent().getMessageManager();

IPublicMessage.IEmpNode node = wdContext.nodeEmp();

IPublicMessage.IEmpElement ele = node.currentEmpElement();

if(ele.getId().length()<3 );

{

msg.raiseMessage(IMessageMessage.MSGID,new Object[]{"id"},true);

msg.reportSuccess("must not be empty");

}

//@@end

}

In the above code to display simple error message, even if i m entering more than 3 digits, it is displaying the error msg.What si the problem????

Former Member
Former Member replied

Hi Pinki,

One quick question.

Are you using a semicolon after the if condition?

<b>if(ele.getId().length()<3 );</b>

{

msg.raiseMessage(IMessageMessage.MSGID,new Object[]{"id"},true);

msg.reportSuccess("must not be empty");

}

If yes, please remove the semicolon and execute your code. Should work.

Regards,

Rekha Malavathu

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question