on 10-17-2008 10:14 AM
Hi
I have a input field with label EMPLOYEE NAME where it should accept only alphabets spacesand dot(.)For example(k.krishna rao).
Thanks
Krishna
Hi,
check the following code it may help you
for (i=0; i<fld.length; i++) {
if (fld.charAt(i) == "." || fld.charAt(i) == "/")
{
//Generate code or
wdcomponentAPI.getMessageManager().reportSuccess(....);
}
and for generating Error Messages you can go through the following documentation.
[https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/60db527d-7be4-2a10-0283-e915cfb179a8]
Regards
Raghu
Edited by: Raghunandan Madarikuruva on Oct 17, 2008 11:15 AM
Edited by: Raghunandan Madarikuruva on Oct 17, 2008 11:33 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
chkInput-->String
2)then do the binding.
3)create message in message pool
MessageKey-->inputValidation
MessageType-->error
MessageText-->you have entered ,which is in not alphabet.
Please enter valid .
3)create Method and check for the input field
and implement your method.
your code may look like this.you can do your manipulation according to your requirement.
public void chkInputField( java.lang.String chkInp)
{
//@@begin CheckDate()
IWDMessageManager msgmgr=wdComponentAPI.getMessageManager();
Integer inInt =(Integer)wdContext.currentContextElement().getAttributeValue(chkInput);
IWDAttributeInfo attinfo=wdContext.getNodeInfo().getAttribute(chkInput);
for (i=0; i<chkInp.length; i++) {
if (chkInp.charAt(i) == "." || chkInp.charAt(i) == "/")
{
//show the error message
msgmgr.reportContextAttributeMessage(wdContext.currentContextElement(),
attinfo,
IMessageMainComp.INPUT_INVALID,
new Object[]{ chkInput},
true);
//@@end
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI kirshna rao ,
Below is a helpful link for input data validation.
just go threw it.
Regards.
Punit Singh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Create a context attribut and map that attribut type with Integer and onEnter create a method where you can put the validation.
Take the help of this code.
DecimalFormat pattern = new DecimalFormat( "#,##0;(#,##0)" );
String numberString = "(1,234)";
Number n = null;
try
{
n = pattern.parse( numberString );
}
catch ( ParseException e )
{
//( "oops:" + numberString );
// n = new Integer( 0 );
}
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.