Sunday 18 May 2014

Retrieve the Old Value of an Attribute in the View Object

This blog we will see how to get the old value of an attribute.


      Let’s consider the situation, if we have an attribute of a view object but we will update the attribute of the view object. Suppose we need to access the old value of the attribute, we need to follow the below steps.
 

     1. Create a transient attribute name as “OldFirstName” in the EmployeesVO view object.
     2. Generate the EmployeesVORowImpl.java on top the view object. While creating the            implementation class we need to follow the below image.


      3. Now open the EmployeesVORowImpl.java, By default the getOldFirstName method looks       like the given below.
    /**
     * Gets the attribute value for the calculated attribute OldFirstName.
     * @return the OldFirstName
     */
    public String getOldFirstName() {
        return (String) getAttributeInternal(OLDFIRSTNAME);
    }


       4. Now we need to edit the same method like below.
    /**
     * Gets the attribute value for the calculated attribute OldFirstName.
     * @return the OldFirstName
     */
    public String getOldFirstName() {
        byte status = EntityImpl.STATUS_UNMODIFIED;
        return (String) getAttributeInternal(FIRSTNAME, status);
    }


   Now run your application and you will get the old value.


  Thanks...

Saturday 10 May 2014

HTML Formatting / applying Style components in ADF outputText

   This blog we will see how to format the HTML components or applying the Style components in ADF outputText.

   In real life scenario, sometimes it is required to use HTML components in ADF page. The below code is required to display the HTML components.


<af:outputText value="&lt;h2&gt;HTML Formating in Output Textbox&lt;/h2&gt;"/>
<af:outputText value="&lt;h2&gt;HTML Formating in Output Textbox&lt;/h2&gt;"
               escape="false"/>
<af:outputText value="&lt;p style='font-family:Arial, Helvetica, sans-serif; font-size:12px'&gt;&lt;strong&gt;&lt;font size='3' color='#FF0000'&gt;Step 1. Perform the following&lt;/font&gt;&lt;/strong&gt;&lt;br&gt;" escape="false"/>


Output:
Thanks...