on 10-17-2008 10:05 AM
Hi
i have a input fied with label AMOUNT the end user should enter only numeric values(123.67) should not allow any other values like alphabets
Thanks
raju
Hi Raju,
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.
Hi,
Go through the following link a good PDF on Validating input form
[https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/837d9290-0201-0010-1381-e633fe17cb14]
Regards
Raghu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi!
1)create a context variablecontext
chkInput-->integer
2)then do the binding.
3)create message in message pool
MessageKey-->intinput
MessageType-->error
MessageText-->you have entered ,which is in not integer.
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 chkInt)
{
//@@begin CheckDate()
IWDMessageManager msgmgr=wdComponentAPI.getMessageManager();
Integer inInt =(Integer)wdContext.currentContextElement().getAttributeValue(chkInput);
IWDAttributeInfo attinfo=wdContext.getNodeInfo().getAttribute(chkInput);
//give your if condition for whatever restriction you want to give
//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
Try creating an simple type of type integer.
Assign this ta Context Value attribute.
Bind it to the Input field.
Corrections:
Create a simple type of Built-in type Float in Local dictionary so that it can accept both int and float values.
When you will click a button then WD Validation Framework will automatically validate the input and dispaly the error message,
Also your Button Action event handler should be created with Without Validation option unchecked.
Siddharth
Edited by: Siddharth Jain on Oct 17, 2008 11:28 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
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.