on 10-16-2009 5:43 PM
Hello All.
How to restrict inputFields in WebDynpro Java to numbers only ?
Thanks in advance..
Taylor
Taylor,
Add a validating action for the inputfield which would check if its numeric or not,
here is how to check,
public void checkIfNumeric( java.lang.String fieldName )
{
//@@begin checkIfNumeric()
IWDMessageManager msgMgr = wdComponentAPI.getMessageManager();
String fieldValue = wdContext.currentVaSearchFiltersElement().getAttributeAsText(fieldName);
IWDAttributeInfo attributeInfo = wdContext.nodeVaSearchFilters().getNodeInfo().getAttribute(fieldName);
try{
Integer.parseInt(fieldValue);
}catch(NumberFormatException nfe){
msgMgr.reportContextAttributeMessage(wdContext.currentVaSearchFiltersElement(),attributeInfo,IMessageSecurityReportComp.ROB__VER__NOT__NUMERIC,
null, true);
}
//@@end
}
In the fieldName - pass the context attribute name and modify the node and sttribute info as required..
Sandip
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Create Context attribute and type is integer
and write the java code for numeric restriction
Regards,
Manivannan P
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.