How TO Restrict user to enter data in CAPS ONLY in OAF
In this exercise we are restricting the user to enter Character in UPPERCASE.

Brief about the steps we are performing
1. Create custom CSS.
2. Attaching this CSS to bean via personalization.
Step1. FTP the latest custom.css from server $Common_Top/html/cabo/style to desktop
Step2. Add the below text in custom.xss

Step 3: Now, FTP the updated custom.xss file to same path on the server i.e. $Common_Top/html/cabo/style.
Step 4: Set the CSS Class Property through Personalization.
CSS Class : XXOraUpperText

Finally after setting css for Project Name bean user can only enter in UPPERCASE only.

Here is another more simpler approach.
Here in the processRequest we are setting the CSS to the Bean without making changes to custom.xss file.

Brief about the steps we are performing
1. Create custom CSS.
2. Attaching this CSS to bean via personalization.
Step1. FTP the latest custom.css from server $Common_Top/html/cabo/style to desktop
Step2. Add the below text in custom.xss

Step 3: Now, FTP the updated custom.xss file to same path on the server i.e. $Common_Top/html/cabo/style.
Step 4: Set the CSS Class Property through Personalization.
CSS Class : XXOraUpperText

Finally after setting css for Project Name bean user can only enter in UPPERCASE only.

Here is another more simpler approach.
Here in the processRequest we are setting the CSS to the Bean without making changes to custom.xss file.
- import oracle.cabo.style.CSSStyle;
- import oracle.apps.fnd.framework.webui.beans.message.OAMessageTextInputBean;
- public void processRequest(OAPageContext pageContext, OAWebBean webBean)
- {
- super.processRequest(pageContext, webBean);
- CSSStyle css =new CSSStyle();
- css.setProperty("text-transform","uppercase");
- OAMessageTextInputBean mtib=(OAMessageTextInputBean)webBean.findChildRecursive("HelloName");
- if(mtib!=null) {
- mtib.setInlineStyle(css);
- }
COMMENTS