Sunday 29 November 2015

How to set the default action in ADF page

This blog we will see how to set the default action in ADF page.

In real time example sometimes we need to submit the form on click of enter key in key board.
Need to add defaultCommand="cb1" for submitting the default action. The code should look like the below


<af:subform id="s1" defaultCommand="cb1">
            <af:inputText label="Name:" id="it1"/>
            <af:commandButton text="Submit" id="cb1"
                              actionListener="#{backingBeanScope.backing_DefaultAction.submitAction}"/>
            <af:commandButton text="Reset" id="cb2"
                              actionListener="#{backingBeanScope.backing_DefaultAction.resetAction}"/>
</af:subform>

Now run your application, it will call the default button.

You Can download the code: Download

Monday 16 November 2015

How to set the default character type for af:inputText in ADF

This blog we will see how to set the default character type for af:inputText in ADF.
We need to add the contentStyle property in af:inputText component.

For upper case character: text-transform:uppercase;
For lower case character: text-transform:lowercase;
For first letter capital: text-transform:capitalize;

The code should look like the below


<af:inputText label="Upper Case : " id="it3"
                       contentStyle="text-transform:uppercase;"
                       shortDesc="All character will be upper case"/>
<af:inputText label="Lower Case: " id="it2"
                       contentStyle="text-transform:lowercase;"
                       shortDesc="All character will be lower case"/>
<af:inputText label="Capital Case : " id="it1"
                       contentStyle="text-transform:capitalize;"
                       shortDesc="First chracter will be capital"/>


Thanks..