Sunday, January 31, 2016

OAF Error : java.lang.IllegalArgumentException: Unknown signal: ALRM


I have seen questions in OTN forum where people seeking clarification on the below error that they see in the log while running OAF pages from Jdeveloper.

java.lang.IllegalArgumentException: Unknown signal: ALRM


This error message can safely be ignored, as per Oracle. And the justification is,
Signal handler was added in order to provide additional debug facilities such that when the ALRM signal is sent to the JVM process, it will dump out AM statistics/information to the console.  The signal handler is only used for diagnostic purposes so this error will not impact the JDeveloper runtime.


You may as well check the MOS note, java.lang.IllegalArgumentException: Unknown signal: ALRM when using JDeveloper With OA Extension (Doc ID 431140.1).

Saturday, January 16, 2016

Change the Color of Prompt and Value of Text field in OAF

In this blog, I try to handle a scenario where we need to set the color of Prompt and Value of a text field in an OAF page.
We will not be able to set the CSS for the text in the prompt of a messageTextInput field. I am sharing a workaround here for that.
We create a rowLayout and two cellFormats with in it. The first cellFormat will have a staticStyledText which holds the Prompt text and the second cellFormat will have a messageTextInput field which holds the Value.

Page XML Code
<oa:header id="TestPromptColRN">  
   <ui:contents>  
   <oa:rowLayout id="RL">  
   <ui:contents>  
   <oa:cellFormat id="Cell1">  
      <ui:contents>  
      <oa:staticStyledText id="SST1" text="PO Number" prompt="PO Number"/>  
      </ui:contents>  
   </oa:cellFormat>  
   <oa:cellFormat id="Cell11">  
      <ui:contents>  
      <oa:messageTextInput id="MTI1"/>  
      </ui:contents>  
   </oa:cellFormat>  
   </ui:contents>  
   </oa:rowLayout>  
   </ui:contents>  
</oa:header>  


Java code to be placed in the processRequest of the Page's Controller.
CSSStyle customCss = new CSSStyle();  
customCss.setProperty("color", "#FF0000");  
OAStaticStyledTextBean sstBean =   
    (OAStaticStyledTextBean)webBean.findChildRecursive("SST1");  
if (sstBean != null)  
    sstBean.setInlineStyle(customCss);  
OAMessageTextInputBean mtiBean =   
    (OAMessageTextInputBean)webBean.findChildRecursive("MTI1");  
if (mtiBean != null)  
    mtiBean.setInlineStyle(customCss); 


The output will be like.



Tuesday, January 5, 2016

Disabling autocomplete in an OAF page

I have come across a question in OTN forum where a user asked to secure the credit card number entry in the Message text field of OAF.
Basically the user was looking for an option to turn off the Auto-Complete of the input field.
He cannot make the field as a Password field, because after data entry the number has to be legible to the user to confirm back with the customer.

Here is the solution given :-

If you have only one field in your page where you want to turn off the Auto complete, you can use the below.

OAMessageTextInputBean textInBean = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("item1");
textInBean.setNoAutoComplete(true);


If you want to turn off the Auto complete for whole page, you can use the below code.

pageContext.putJavaScriptFunction("disableAutoComplete","function disableAutoComplete() { document.DefaultFormName.autocomplete='off';}");
OABodyBean bodyBean = (OABodyBean) pageContext.getRootWebBean();
bodyBean.setOnLoad("disableAutoComplete();");