Anil's Blog is Best Viewed on GOOGLE CHROME

Monday, August 2, 2010

How to make selected row Read Only in Table



In this exercise, we are making read only one column of a Table Bean on the click of a image column.


Steps:

1. Create one Boolean Transient Attribute in existing VO.



 2.  Set the SPEL syntax into the Read Only property for the attributes of table that you want to make read only. In below screenshot I have set it for one column.




3.  Create event on image column. Name of Event : update


Controller Code

import oracle.apps.fnd.framework.OARow;

public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
  {
    super.processFormRequest(pageContext, webBean);
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    if ("update".equals(pageContext.getParameter(EVENT_PARAM)))
    {
          String rowReference = pageContext.getParameter(OAWebBeanConstants.EVENT_SOURCE_ROW_REFERENCE);
          if(rowReference != null)
          {
            TestVORowImpl xxvorowimpl = (TestVORowImpl)am.findRowByRef(rowReference);
            xxvorowimpl.setreadOnlyAttr(Boolean.TRUE);
          }
        
    }
  }

Cheers!!!

Tuesday, June 8, 2010

Attachment Feature in Advanced Table

Please go through article Advanced Table in Advanced Table via View Link as I am creating attachment link in the existing Advanced Table Region.

This exercise has nothing to do with above mentioned exercise I just referred the already created table region to add the Attachment feature in existing screen.

Steps Followed

1. Create a new column inside the existing Advanced Table Region.
2.  Right click on that column  à New à Item.
3.  Item Style: attachmentImage
     Set following Property of this item:
                                                        *   Automatic Save   à  True
                                                        *   View Instance  ChildVO2








4. When you create item of Type attachmentImage automatically an entityMap get created.
     Set the Entity : DEMO_PA_ASSIGNMENT [This is what we put for testing].






5. Right Click on entityMap and create primaryKeys and here set the View Attribute property of it.






Save your work. Import page again to see the changes. Finally the page will look like this.









Advanced Table in Advanced Table via View Link

This article is contributed by my friend - Pranav Maheshwari. Thanks for his extended support.

In this article we are creating Advanced table in Advanced Table and show the details region data by creating View Link between these tables View Object.




Steps you need to follow.

1. Create a Advanded Table Region on page. We call it Main Table Region.





2. Right click on Table region and click on New -> detail. We call it detail region
3. This details table region will show those column which are not availabe intially when page renders.
4. Create a Application Module
5. Create a Controller.
5. Create Two View Object let say ParentVO and Child VO.
7. Create a View Link between these two view objects.
















8. Take an instance of View Object and View Link in Application Module



Things to remember
1. Both View Object must have one same Key Attribute. Like in our case it is Assignment Id.



2. Also create a Transient Attribute in MasterVO of Boolean Type. We name it DetailFlag.




In Main Table Region set the following property.

1. View Instance: ParentVO1
2. Details View Attribute: DetailFlag
3. Child View Attribute: AssignmentId
4. View Link Instance: MasterToDetailsVL1




In Details Table Region set the following property.

1. View Instance: ChildVO2
2. View Link Instance: MasterToDetailsVL1



Controller CODE:

import oracle.apps.fnd.common.VersionInfo;
import oracle.apps.fnd.framework.webui.OAControllerImpl;
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import xx.oracle.apps.pa.tableaudit.server.MainApplicationAMImpl;;


public void processRequest(OAPageContext pageContext, OAWebBean webBean)
  {
    super.processRequest(pageContext, webBean);
    MainApplicationAMImpl AM=(MainApplicationAMImpl)pageContext.getApplicationModule(webBean);
    pageContext.writeDiagnostics(this, "Calling Method", 1);
    AM.AssignmentAuditDetails(pageContext,webBean);
  }


Application Module CODE:

import oracle.apps.fnd.framework.server.OAApplicationModuleImpl;
import oracle.jbo.server.ViewLinkImpl;
import oracle.apps.fnd.framework.server.OAApplicationModuleImpl;
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;

public void AssignmentAuditDetails(OAPageContext pageContext,OAWebBean webBean)
  {
    ParentVOImpl pvo = getParentVO1();
    pvo.executeQuery();
  }