Friday, September 25, 2015

Message File Upload Bean

import oracle.apps.fnd.framework.webui.beans.message.OAMessageFileUploadBean;
import oracle.apps.fnd.framework.webui.OADataBoundValueViewObject;

code in PR for Defaulting the file name to Message File upload bean

PR Code:
OAMessageFileUploadBean attachmentBean = (OAMessageFileUploadBean)webBean.findChildRecursive("UploadItem");
OADataBoundValueViewObject attachmentNameBoundValue = new OADataBoundValueViewObject(attachmentBean, "FileName");
attachmentBean.setAttributeValue(DOWNLOAD_FILE_NAME, attachmentNameBoundValue);

where UploadItem is the Id of the MessaageFileUpload Bean.

PFR Code to get filename when MessageFileUploadBean is used in table Region

    while(vo.hasNext()) 
    {
    Row row=vo.next();
    String StrAttachId="AttachmentRN.UploadItem";
    i=i+1;
    StrAttachId=StrAttachId+i;
    DataObject fileUploadData = pageContext.getNamedDataObject(StrAttachId);
    if(fileUploadData != null)
    {
    strFileName= fileUploadData.selectValue(null,"UPLOAD_FILE_NAME").toString();
    row.setAttribute("FileName",strFileName);
    }
    }