Thursday 22 May 2014

Add CSS to af:table column header in ADF page

Hi, In this post i am going to show you how to add the css to column header of af:table

Step1: Create the ADF Skin file (.css file)

Step2: Create the css class as shown below

.head{
font-size: 20.0pt;
font-weight: bold;
color: Red;

}

Step3: Call the css class on af:column  (headerClass="head")

Step4: Run the page.


Thanks :) happy learning :)

Wednesday 21 May 2014

Convert input text Content to Upper Case or Lower Case

In this post i am going to talk about converting lower case data to upper case (or Upper Case data to Lower Case). There are multiple solutions to achieve this but i am showing there different methods.

1. you can use contentStyle="text-transform:uppercase;" on input text field.
        --text-transform:lowercase;
   
       
2. Using java script code

<af:resource type="javascript">
      function convertToUpperCase(evt){
        var field = evt.getCurrentTarget();
        var fieldVal= field .getSubmittedValue();
        field .setValue(fieldVal.toUpperCase());        
    }
    </af:resource>


 <af:inputText label="Label 1" id="it1">
                <af:clientListener method="convertToUpperCase" type="valueChange"/>
              </af:inputText>


3. You can create ViewRowImpl.java class with accessors and use toUpperCase() of String class

    public void setFirstName(String value) {
        setAttributeInternal(FIRSTNAME, value.toUpperCase());
    }


Thanks :) Happy Learning :)