on 08-20-2007 8:15 AM
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????
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Remove the semicolon from the if loop
Regards
Chandran S
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
first of all if i m calling the method reportsuccess after raisemessage, it is not displayig because my MSGID is of error type, and program execution is stopping after that.
in both od the cases, id input is of length greater than 3 digits, the error persists
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
i tried with if(Integer.parseInt(ele.getId()) < 3 ),
the error is still there
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
1) If you have this code:
if(ele.getId().length()<3 )
{
msg.raiseMessage(IMessageMessage.MSGID,new Object[]{"id"},true);
msg.reportSuccess("must not be empty");
}
Then for input 0 to 99 you will get the message "must not be empty".
For values higher or equal than 100 you will not get the message.
Please check if this is happening ?
2) If you code like this:
if(Integer.parseInt(ele.getId()) < 3 )
{
msg.raiseMessage(IMessageMessage.MSGID,new Object[]{"id"},true);
msg.reportSuccess("must not be empty");
}
For input 0-2 you will get the message "must not be empty".
For values higher or equal to 3 you will not get the message.
Please check if this is happening ?
Regards,
Ashwani Kr Sharma
it is taking the no. of digits i m inputing...that is if i m inputing 6 digits it is showing 6, if input is 7 digits than it is displaying 7......so now????
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It must be length of string... so if you input 12345 it will not show error.
If you enter 12 it will show the error.
You comparing length of string not the int value.
try:
if(Integer.parseInt(ele.getId()) < 3) {
msg.raiseMessage(IMessageMessage.MSGID,new Object[]{"id"},true);
msg.reportSuccess("must not be empty");
}
Regards,
Ashwani Kr Sharma
by default it is displaying '6'.....
dt is it must tk atleast 6 digits
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
the method reportsuccess(string) int he IWDMessageManager is not applicable for the arguments(int)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Can you check following in the if clause
msg.reportSuccess(ele.getId().length());
Just to check what is the length of the Id field. May be you comparing wrong value here.
Regards,
Ashwani Kr Sharma
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi....
my problem is dt originally if my id legth is less than 3 digits than it should display the error message 'MSGID'...however, even if i m inputing more than 3 digits in the input field , it is displaying the error message.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI pinki,
tell me..briefly
whats ur problem?
i didn't get ur problem?
Regards,
P.Manivannan.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.