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..

Saturday 31 October 2015

How to set the width of input text box in ADF

To set the width of input text box we need to set the width in contentStyle. Add like the below code

<af:inputText contentStyle="width:100px;"/>

Now run your page automatically the width will set as per your define width.

Thanks...

How to expand the first node of tree table on page load

Add the below properties on af:treeTable

initiallyExpanded="true"

Now run you page on page load the first node will expand always.

Thanks..

Use of autotab in ADF

This blog we will see how to use auto tab in ADF.
Some times in real life example you can see after filling the one textbox automatically it will move to next box. Screen is like the below
Let’s consider a requirement, we have two text box and while user entering the text after 3 character automatically we need to move to next text box.
The below steps we need to follow
1. Create two textbox.
2. Add maximumLength="3" and autoTab="true" for the first text box.
The code should looks like the below.


<af:inputText label="First Name" id="it1"
                           maximumLength="5" autoTab="true"/>
<af:inputText label="Last Name" id="it2"/>

Now run you application and after entering the first text automatically it will move to next.

Thanks..

Wraping content of output text in ADF

This blog we will see how to wrap the value of output text.
Some time in real life development we will get a requirement, to wrap the value of output text if the value is long.

We need to add the inline style class like the below.

inlineStyle="width:50px;display:inline-block;word-wrap:break-word"

Now run your page as per the width it will wrap the text.

Thanks...

Thursday 29 October 2015

Displaying a Popup on Page Load


This blog we will see how to display a popup on page load.
The below steps we need to follow to display a popup on page load.
1. Create a page which one you want to display on Page.
2. Create a popup which one you want to display after the page load.


<af:popup childCreation="deferred" autoCancel="disabled" id="p1">
      <af:dialog title="Displaying the Popup on Page Load" id="d2">
            <f:facet name="buttonBar"/>
            <af:panelFormLayout id="pfl1">
            <af:outputText value="This is the onload popup." id="ot2"/>
            </af:panelFormLayout>
      </af:dialog>
</af:popup>

3. Add the af:showPopupBehaviorafter the af:form like the below
4. Now set the trigger type to load in af:showPopupBehavior.
 Now run your page and the popup will comes up after page load like the below.
You Can download the code: Download

Thanks..