Search This Blog

Wednesday, February 26, 2014

Jdeveloper integrated server issue: Unable to create a server socket for listening on channel "Default". Cannot assign requested address: JVM_Bind

Unable to create a server socket for listening on channel "Default". The address xxx.xx.xxx.xxx might be incorrect or another process is using port 7101: java.net.BindException: Cannot assign requested address: JVM_Bind.

Server failed. Reason: Server failed to bind to any usable port

Solution to overcome this error is simple two step process.

Step1: Rename the folder JDeveloper  under :\Users\xyz\AppData\Roaming\ to something else. 
Note: AppData folder is a hidden folder in windows.

Step 2: Restart your JDeveloper and start the integrated server, this will prompt the user to create the DefaultDomain with new parameters. Users can enter the following parameters once again and configure the defaultDomain all over again.

Address : User will be provided with a drop down with following values
        a) 127.0.0.1
        b) localhost
        c) IP address 

Port: 7101, 7001 or any desirable port.

These settings will let you re-configure the DefaultDomain or IntegratedDefaultDomain.

Note: This will create a new folder :\Users\xyz\AppData\Roaming\JDeveloper.



Friday, October 11, 2013

Convert string to jbo date

Make sure the format of the date is set as per your requirement. 

                  formatter = new SimpleDateFormat("EEE MMM d hh:mm:ss z yyyy");
                  date = formatter.parse(aDate);
                  java.sql.Date sqlDate = new java.sql.Date(date.getTime());
                  oracle.jbo.domain.Date jboDate = new oracle.jbo.domain.Date(sqlDate);

If you want the date to be locale specific, use the following

                 formatter = new SimpleDateFormat(pattern, currentLocale); 

Here are some customized Date and Time formats (from Oracle Site)


Customized Date and Time Formats
Pattern Output
dd.MM.yy 30.06.09
yyyy.MM.dd G 'at' hh:mm:ss z 2009.06.30 AD at 08:29:36 PDT
EEE, MMM d, ''yy Tue, Jun 30, '09
h:mm a 8:29 PM
H:mm 8:29
H:mm:ss:SSS 8:28:36:249
K:mm a,z 8:29 AM,PDT
yyyy.MMMMM.dd GGG hh:mm aaa 2009.June.30 AD 08:29 AM

Wednesday, August 7, 2013

Authentication/Authorization managed by OAM in Weblogic

Configuration from Weblogic Console

Security Configuration

1. Login to weblogic console.

2. Click on Security Realms -> myrealm -> Providers.
    Click New.
    Enter Name : WebLogic_IdentityAsserter
    Type: "OAM Identity Asserter"
    Click OK.

3. Once done, Click on WebLogic_IdentityAsserter.
    Make the Control Flag to “SUFFICIENT”
    Add “OAM_REMOTE_USER” to chosen side of Active Types.
    Save the changes.

4. Go to the Provider Specific tab.
    And update the SSOHeadername to OAM_REMOTE_USER
    Save the changes.

5. Go to Security Realms -> myrealm -> Providers.
    Click New.
    Name: DSX
    Type: OpenLDAPAuthenticator.
    Click OK

6. Go to provider page and click on DSX.
    Mark the Control Flag as “OPTIONAL”

7. Click on Provider Specific tab.
    Update the following details for LDAP configuration.

Host :
Port 389 (Default port)
Principal
Credentials
Confirm Credentials
User Base DN O=<>
User From Name Filter (&(uid=%u)(objectclass=person))
User Name Attribute uid
User Object Class person
Use Retrieved User Name as Principal
Group Base DN ou=GROUPS,o=<>
Group From Name Filter (&(cn=%g)(objectclass=group))
Static Group Name Attribute cn
Static Group Object Class group
Static Member DN Attribute member
Static Group DNs From Member DN Filter (&(member=%M)(objectclass=group))
GUID Attribute objectGUID

Save the changes.


8. Go to Security Realms -> myrealm ->Providers.
    Click on DefaultAuthenticator
    Make the Control Flag as “OPTIONAL”.
    Save the changes.

9. Make sure Provider Specific setting is a below:
    Go to Security Realms -> myrealm -> Providers.
    Select the check box for DefaultIdentityAsserter.
    Click Delete.

10. Activate the changes & Restart all servers.

Tuesday, July 30, 2013

To Find Dirty data (uncommitted) in ADF task flow

ControllerContext cctx = ControllerContext.getInstance();
cctx.getCurrentViewPort().getTaskFlowContext().is DataDirty();

or

cctx.getCurrentViewPort().isDataDirty();

or

ViewPortContext.isDataDirty();

Sunday, June 30, 2013

OAF - Pass parameters between pages and session

OAPageContext (called from UI client)
putSessionValue( )
removeSessionValue( )
getSessionValue( )

OAPageContext (called from UI client for encryption)
PutEncryptedParameter( )
GetDecryptedParameter( )

OAPageContext (called from UI client)
putTransactionValue( )
getTransactionValue( )
removeTransactionValue( )

OADBTransaction (called from server)
putValue( )
getValue( )
removeValue( )

Format negative numbers with bracket in ADF screens.

In Financials, it is important that negative numbers are displayed/formatted within brackets or braces.

Challenge comes in when the the column or UI attribute holds both positive and negative number.

Solution : On the UI Attribute, place with pattern as "#,##,###.00;(##,##,###.00)"
Or
If the UI is based on a VO, edit the attribute properties and specify the below details as part of the Control Hints. without the double quotes formattype as "Number" and format as "#,##,###.00;(##,##,###.00)"

The key here is semi-colon(;) seperating the value of the format, ADF internally recognizes that the second format value is for negative number.

Reference scope variable in VO as bind parameter

Reference scope variable in VO as bind parameter.

Note: Accessing scope variable in VO is violation of MVC but can be performed using below groovy experssion.

adf.context.expressionEvaluator.evaluate('#{pageFlowScope.empNo}')

get ADF Logger root directory at runtime

ADFLogger logger;

logger = ADFLogger.createADFLogger(MyClass.class);

InitialContext ctx = new InitialContext();
           
MBeanServer server = (MBeanServer)ctx.lookup("java:comp/env/jmx/runtime");
        
ObjectName service =new ObjectName("com.bea:Name=RuntimeService,Type=weblogic.management.mbeanservers.
runtime.RuntimeServiceMBean");

ObjectName domain =(ObjectName)server.getAttribute(service, "DomainConfiguration");

rootDir = (String)server.getAttribute(domain, "RootDirectory");

logger.info("Root Dir : " + rootDir);

Wednesday, May 22, 2013

Essential Date functions for ADF


    public static java.util.Date convertSqlToUtilDate(java.sql.Date date) {
        Date utilDate = null;
        if (date != null) {
            utilDate = new Date(date.getTime());
        }
        return utilDate;
    }

    public static oracle.jbo.domain.Date convertSqlToJboDate(java.sql.Date date) {
        oracle.jbo.domain.Date jboDate = null;
        if (date != null) {
            jboDate = new oracle.jbo.domain.Date(date);
        }
        return jboDate;
    }

    public static java.sql.Date convertUtilToSQLDate(java.util.Date date) {
        java.sql.Date sqlDate = null;
        if (date != null) {
            sqlDate = new java.sql.Date(date.getTime());
        }
        return sqlDate;
    }

    public static oracle.jbo.domain.Date convertUtilToJboDate(java.util.Date date) {
        oracle.jbo.domain.Date jboDate = null;
        if (date != null) {
            jboDate = new oracle.jbo.domain.Date(convertUtilToSQLDate(date));
        }
        return jboDate;
    }

    public static java.sql.Date convertJboToSqlDate(oracle.jbo.domain.Date date) {
        java.sql.Date sqlDate = null;
        if (date != null) {
            sqlDate = (Date)date.getValue();
        }
        return sqlDate;
    }


    public static java.util.Date convertJboToUtlDate(oracle.jbo.domain.Date date) {
        java.util.Date sqlDate = null;
        if (date != null) {
            sqlDate = (java.util.Date)date.getValue();
        }
        return sqlDate;
    }

Friday, May 10, 2013

Oracle Projects Navigation Paths

Accounting Calendar : Setup > Financials > Calendar > Periods

Agreement : Billing > Agreements

Agreement Template : Setup > Billing > Agreement Templates

Agreement Types : Setup > Billing > Agreement Types

AR Payment Terms : Setup > Billing > Payment Terms

Assign AutoAccounting Rules : Setup > AutoAccounting > Assign Rules

Assign Descriptive Security Rules : Setup > Flexfields > Descriptive > Security > Assign

Assign Key Flexfield Security Rules : Setup > Flexfields > Key > Security > Assign

AutoAccounting Lookup Sets : Setup > AutoAccounting > Lookup Sets

AutoAccounting Rules : Setup > AutoAccounting > Rules

Bill Rate Schedules : Setup > Billing > Bill Rate Schedules

Billing Extensions : Setup > Billing Extensions

Budget Change Reasons : Setup > Budgets > Change Reasons

Budget Entry Methods : Setup > Budgets > Entry Methods

Budget Types : Setup > Budgets > Budget Types

Budgets Budgets

Burden Cost Codes : Setup > Costing > Burden > Cost Codes

Burden Schedules : Setup > Costing > Burden > Schedules

Burden Structures : Setup > Costing > Burden > Structures

Capital Projects

Class Categories and Codes : Setup > Projects > Classifications

Compensation Rules : Setup > Costing > Labor > Compensation Rules

Contact Types : Setup > Project > Customers > Contact Types

Control Actions : Setup > Activity Management Gateway > Control Actions

Control Billing by Top Task : Billing > Control Billing by Top Task

Cost Bases : Setup > Costing > Burden > Bases

Credit Types : Setup > Billing > Credit Types

Cross Validation Rules : Setup > Flexfields > Key > Rules

Customers : Setup > Customers > Customer Entry

Descriptive Flexfield Security Rules : Setup > Flexfields > Descriptive > Security > Define

Descriptive Flexfield Segments : Setup > Flexfields > Descriptive > Segments

Descriptive Flexfield Values : Setup > Flexfields > Descriptive > Values

Dimensions : Setup > Collection Pack > Dimension

Employee Cost Rates : Setup > Costing > Labor > Employee Cost Rates

Enter Person : Setup > Human Resources > Employees

Event Entry and Inquiry Windows : Billing > Events

Event Types : Setup > Billing > Event Types

Expenditure Batches : Expenditures > Pre-Approved Batches > Enter

Expenditure Batches Summary : Expenditures > Pre-Approved Batches > Review

Expenditure Categories : Setup > Expenditures > Expenditure Categories

Expenditure Inquiry : Expenditures > Expenditure Inquiry Project

Expenditure Inquiry Across Projects : Expenditures > Expenditure Inquiry All

Expenditure Items : Expenditures > Expenditure Inquiry Project or All

Expenditure Types : Setup > Expenditures > Expenditure Types

Find Expenditure Batches : Expenditures > Pre-Approved Batches > Review

Find Invoices : Billing > Invoice Review

Flexfield Security Rules : Setup > Flexfields > Validation > Security > Define

Flexfield Value Sets : Setup > Flexfields > Validation > Sets

Flexfield Values : Setup > Flexfields > Validation > Values

GL Accounts : Setup > Financials > Accounts

Implementation Options : Setup > System > Implementation Options

Invoice Formats : Setup > Billing > Invoice Formats

Invoice Summary : Billing > Invoice Review

Job : Setup > Human Resources > Jobs

Key Flexfield Security Rules : Setup > Flexfields > Key > Security > Define

Key Flexfield Segments : Setup > Flexfields > Key > Segments

Labor Cost Multipliers : Setup > Costing > Labor > Cost Multipliers

Location : Setup > Human Resources > Locations

Maintain PA Period Statuses : Setup > System > PA Periods

Mass Update Batches Project : Maintenance > Mass Update Batches

Non-Labor Resources : Setup > Expenditures > Non-Labor Resources

Organization : Setup > Human Resources > Organizations > Define

Organization Hierarchies : Setup > Human Resources > Organizations > Hierarchies

PA Periods : Setup > System > PA Periods

Payment Terms : Setup > Billing > Payment Terms

Percent Complete Project : Status > Percent Complete

Period Types : Setup > Financials > Calendar > Types

Personal Profile Values : Other > Profile

Pre-Approved Expenditure Batch Review : Expenditures > Pre-Approved Batches > Review

Pre-Approved Expenditure Entry : Expenditures > Pre-Approved Batches > Enter

Project Customer Relationships : Setup > Projects > Customers > Relationships

Project Funding Inquiry : Billing > Funding Inquiry

Project Role Types : Setup > Projects > Role Types

Project Status Inquiry : Project Status > Project Status Inquiry

Project Status Inquiry Columns : Setup > Project Status Columns

Project Statuses : Setup > Projects > Statuses

Project Types : Setup > Projects > Project Types

Projects Templates Summary : Setup > Projects > Project Templates

PTE Employee Assignment to Operating Unit : Setup > Expenditures > PTE-Multiple Org

QuickCodes : Setup > Human Resources > QuickCodes

Request Set  : Other > Requests > Set

Resource Lists : Setup > Budgets > Resource Lists

Revenue Categories : Setup > Expenditures > Revenue Categories

Revenue Review Windows : Billing > Revenue Review

Review Online Time and Expense : Expenditures > Online Expenditure Review > Supervisor

or

Expenditures > Online Expenditure Review > All

Review Transactions : Expenditures > Transaction Import > Review Transactions

Role Types : Setup > Projects > Role Types

Rollup Groups : Setup > Flexfields > Key > Groups

Segment Values : Setup > Flexfields > Key > Values

or

Setup > Flexfields > Descriptive > Values

or

Setup > Flexfields > Validation > Values

Service Types : Setup > Projects > Service Types

Set of Books : Setup > Financials > Books

Shorthand Aliases : Setup > Flexfields > Key > Aliases

Source Products : Setup > Activity Management Gateway > Source Products

Submit Requests : Other > Requests > Run

System Options : Setup > Customers > System Options

Transaction Controls Projects. Find the project for which you want to enter transaction controls. Choose Open. Select Transaction Controls from the Project Options.

or

Projects. Find the project. Choose Open. Select Tasks. Chose the task for which you want to enter transaction controls. Choose Options. Choose Transaction Controls from the Task Options.

Transaction Sources : Setup > Expenditures > Transaction Sources

Units : Setup > Expenditures > Units

Value Sets : Setup > Flexfields > Validation Sets

View Burdened Costs : Setup > Costing > Burden > View

Monday, March 4, 2013

Add/Remove row from a table and subsequently Refresh a table

Add/Remove row from a table and subsequently Refresh a table.

The button ID is referenced in the table's "partialTrigger" property so that clicking the button initiates a table refresh

BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
OperationBinding operationBinding = bindings.getOperationBinding("Commit");
Object result = operationBinding.execute();
if (!operationBinding.getErrors().isEmpty()) {
//handle errors if any //... return;
}
AdfFacesContext.getCurrentInstance().addPartialTarget( this.getDepartmentsTable());

----------------------------------
1. Creating a binding for the table on which you want to delete the row. Binding creates setter method setMyTable(RichTable table) and getter method like getMyTable() returning RichTable.

2. On a button click or on any other action delete the table row as below.

DCIteratorBinding dciter = (DCIteratorBinding) bindings.get("MyVOIterator");
Row currentRow = dciter.getCurrentRow();
dciter.removeCurrentRow();
AdfFacesContext.getCurrentInstance().addPartialTarget( this.getMyTable());

Wednesday, February 20, 2013

JDeveloper closes abruptly on trying to open

Sometimes its frustrating to see Jdev closing immediately on opening. We try restarting the machine, re-installing jdev...and nothing seems to be working.
 
This is a sign that something got corrupted on Jdeveloper.
 
Best way to get over this issue is to restore it back to the original setting (Ofcourse you loose all your settings, preferences, svn connection, DB settings, external tools, etc ..).
 
The way you do this is by removing system11.1.1.* folder under jdeveloper. Yes, not the best soution, but better than re-installing jdeveloper.

On restarting JDeveloper, it creates a new system11.1.1* directory.

Friday, October 26, 2012

Detect the browser type and version in ADF

How-to detect the browser type and version


The Trinidad RequestContext object provides access to the user browser type and browser version. using Expression Language as

#{requestContext.agent.agentName}

#{requestContext.agent.agentVersion}

Trinidad RequestContext class is exposed through the AdfFacesContext class, which means that we can also use

#{adfFacesContext.agent.agentName}

#{adfFacesContext.agent.agentVersion}

Thursday, October 18, 2012

OAF setup on server before running Oracle Self-Service Web Applications

Configure environment variables and servlet zone list, these are prerequisite before deploying the OAF code on to the server.  (Courtesy : Oracle Documentation)

1. Locate the file jserv.properties.
All environment variables are set in this file. It is important to get $CLASSPATH and $LD_LIBRARY_PATH correct here. You can look at APPLSYS.env and adovars.env under $APPL_TOP for these two variable settings.

2. In jserv.properties, modify the following parameters:
wrapper.bin
The wrapper.bin property must contain the full path to the executable for the Java Virtual Machine. It sets which Java Virtual Machine interpreter to use here. For example:
wrapper.bin=/local/java/jdk1.1.6/bin/java

wrapper.classpath
This property contains the CLASSPATH environment value passed to the JVM. The wrapper.classpath property must contain both the JSDK and the JServ jar file. It should probably also contain the JVM's classes.zip file and directives of servlet zones.
The syntax is:
wrapper.classpath=[path]
For example:
wrapper.classpath=/usr/local/ApacheJServ/jservlets
wrapper.classpath=/local/java/jdk1.1.6/lib/classes.zip
wrapper.classpath=/usr/local/ApacheJserv/src/java/ApacheJServ.jar

wrapper.env
This property is an environment name whose value is passed to the JVM.
The syntax is:
wrapper.env=[name]=[value]

You should set the $LD_LIBRARY_PATH variable here to the directory which contains the JDBC library file. For example:
wrapper.env=LD_LIBRARY_PATH=/oracle/db/8.1.6.1/lib

NLS environment variables should also be set here for the JDBC to operate. For example:
wrapper.env=NLS_LANG=AMERICAN_AMERICA
wrapper.env=ORA_NLS33=/opt/tools/ocommon/nls/admin/data
wrapper.env=NLS_DATE_FORMAT=DD-MON-RR

zones
This property lists the servlet zones that JServ manages. The syntax is:
zones=,
For example:
zones=jservlets

You must specify the configuration file location for each servlet zone that is specified. For example:
jservlets.properties=/usr/local/ApacheJServ/jservlets/

Monday, October 15, 2012

Find the ADF component from the page source.

When the JSF page becomes bulkier, the HTML view source of JSF pages is not very easily readable.
Setting the below flag in trinidad-config.xml ( under view controller -> Web Content -> WEB-INF) will add comments showing which ADF component caused which HTML to be rendered.


<debug-output>true </debug-output>


Found it very handy and useful.

Sunday, September 30, 2012

Build and Manage View Criteria dynamically in ADF

View Criteria :

Using Structured Where Clauses: View criteria are structured criteria that you can use to assemble a WHERE clause. Instead of changing WHERE clauses using string manipulation, you may find it more efficient to use view criteria to assemble complex WHERE clauses in conjunctive normal form.
To use structured WHERE clauses:

1. Instantiate the a ViewCriteria class by calling createViewCriteria() on the view object instance. For example, to create view criteria for the view object instance myOrdVO , you could use the following code:

ViewCriteria vc = myOrdVO.createViewCriteria();

2. For each view criteria row you will need, create a view criteria row by calling createViewCriteriaRow() on the ViewCriteria,

Example: ViewCriteriaRow cRow = vc.createViewCriteriaRow();


3. Set the requirements for each view criteria row by calling setAttribute() on the ViewCriteriaRow. Pass setAttribute() the name of the view object attribute and the SQL requirement to be applied to the attribute:

cRow.setAttribute("OrderTotal", "> 500");

cRow.setAttribute("CreditLimit", "> 2500");

cRow.setAttribute("PromotionId", "IS NOT NULL");


4. Add the rows to the view criteria by passing them to addElement() on the ViewCriteria:
vc.addElement(cRow);


5. Apply the view criteria to the view object instance by passing the ViewCriteria to applyViewCriteria():
myOrdVO.applyViewCriteria(vc);

At any time, you can do any of the following:

 Change the requirements in any row using setAttribute()

 Add further rows to the criteria using addElement()

 Remove rows from the criteria using removeElement()

 Construct and apply entirely different view criteria

 Unapply view critera by passing null to applyViewCriteria()

Wednesday, September 19, 2012

ADF Taskflow programatic refresh

Refreshing a taskflow sometimes becomes very essential in scenarios where we have multiple pages/fragments in a task flow and the business process requires multiple taskflows and each taskflows are interconnected.

For example :

Taskflow 1 has Pagefragment1, Pageframent2, Pagefragment3 and are executed in the same sequence based on your busines scenario.

Taskflow 2 has Pagefragment3, Pageframent4, Pagefragment5

Now on completion of Taskflow 1 (i.e Pagefragment 3), we call taskflow 2 and for any reason based on business logic we have to  go back to taskflow1. Surprisingly, taskflow1 starts at Pageframent 3 and NOT at Pageframent1, even though we set the default task for Taskflow1 as Pageframent1.

In such a scenario, we need to refresh the task flow that we instead to call by getting handler to the taskflow binding and refresh the taskflow. Refresh of taskflow re-renders/re-executes the taskflow starting from the default selection in the task flow. Below is the code snippet to do the same.

DCTaskFlowBinding tf = (DCTaskFlowBinding) JSFUtils.resolveExpression("#{binding.mytaskflow}");

//Refresh taskflow

tf.getRegionModel().refreshh(FacesContext.getCurrentinstance());

Generic Revenue Recognition Rules

Revenue generally is earned and realized or realizable when all of the following criteria are met:

Persuasive evidence of an arrangement exists. The requirement that persuasive evidence of an arrangement exists is intended to ensure that the understanding between the parties about the specific nature and terms of a transaction has been finalized. Determining the proper accounting treatment for a transaction depends on evidence of the final understanding between the parties, because a change in terms could lead to a different conclusion regarding the revenue recognition model to apply.

Delivery has occurred or services have been rendered. Unless delivery has occurred or services have been rendered, the seller has not substantially completed its obligations under the terms of the arrangement, and revenue should not be recognized. Delivery is generally deemed to have occurred when the customer takes title and assumes the risks and rewards of ownership.

The seller’s price to the buyer is fixed or determinable. Whether the price is fixed or determinable depends on many factors, including payment terms, discounts, and rebates, which can vary from arrangement to arrangement. In determining whether the price is fixed or determinable, entities should evaluate all elements of an arrangement to ensure that amounts recognized as revenue are not subject to refund or adjustment.

Collectibility is reasonably assured. If the collection of fees in an arrangement is not reasonably assured, the general principle of being realized or realizable is not met, and revenue recognition is precluded until collection is reasonably assured.

Monday, September 10, 2012

Export To Excel in ADF

ADF 11g has provided the feature of exporting to excel using export listener as follows

<af:exportCollectionActionListener exportedId="tableId" type="excelHTML" title="My Excel Document" filename="testFile.xls"/>

This feature has couple of limitation

1. Export can be based on a single table. If multiple tables are given we get the following error.
Exported collection with the ID of: t1 t2 was not found. with t1, t2 being table Ids.

2. The current feature doesn't allow to export data based on page iterators. As there are many scenarios we base our export to excel on different data(iterators) in the real world.   A traditional approach of exporting data has addressed the above two problems. Below is the code...

public String exporttoexcel_action() throws IOException {
         String filename = "testFile.xls";
         FacesContext fc = FacesContext.getCurrentInstance();
         BindingContainer bc = BindingContext.getCurrent().getCurrentBindingsEntry();
         // get response object.
         HttpServletResponse response = (HttpServletResponse)fc.getExternalContext().getResponse();
         // Set the file name
         response.setHeader("Content-disposition", "attachment; filename=" + filename);
         // Set MIME type to excel
         response.setContentType("application/vnd.ms-excel");
         PrintWriter out = response.getWriter();

         DCIteratorBinding theateriter = (DCIteratorBinding)bc.get("MyVO1Iterator");         
         printtoexcel(theateriter,out);

         out.println();

         DCIteratorBinding areaiter = (DCIteratorBinding)bc.get("MyVO2Iterator");
         printtoexcel(theateriter,out);
         out.close();

         fc.responseComplete();
         return null;
}



public void printtoexcel(DCIteratorBinding iter, PrintWriter out) {
         RowSetIterator rsi = iter.getRowSetIterator();
         String[] attNames = rsi.getRowAtRangeIndex(0).getAttributeNames();
         for (int i = 0; i < attNames.length-1; i++) {
         if (i > 0)
                out.print("\t"); // tab after each value
         out.print(attNames[i]);
}

Alternate Appraoches :

1. Using Apache open source POI APIs.
2. Other way to overcome this limitation is to override the export collection action listener class. (Never tried).

Friday, September 7, 2012

Programatically hide and show popup in ADF 11g

Programatically hide and show popup in ADF 11g

/**
* Show popup.
*/

import org.apache.myfaces.trinidad.render.ExtendedRenderKitService;
import org.apache.myfaces.trinidad.util.Service;

public static void showPopup(UIComponent pId) {

        String popupId= (String )pId.getClientId(getFacesContext());
        FacesContext context = null;
        ExtendedRenderKitService extRenderKitSrvc = null;
        StringBuilder script = new StringBuilder();
        context = FacesContext.getCurrentInstance();
        extRenderKitSrvc = Service.getRenderKitService(context, ExtendedRenderKitService.class);
        script.append("var popup = AdfPage.PAGE.findComponent('").append(popupId).append("'); ").append("popup.show();");
        extRenderKitSrvc.addScript(context, script.toString());
}

/**
* Hide popup.
*/

public static void hidePopup(UIComponent pId) {
        String popupId= (String )pId.getClientId(getFacesContext());
        FacesContext context = FacesContext.getCurrentInstance();
        ExtendedRenderKitService erkService = Service.getService(context.getRenderKit(),            ExtendedRenderKitService.class);
       erkService.addScript(context,"AdfPage.PAGE.findComponent('" + popupId + "').hide();");
}