Skip to main content

Posts

Useful ADF Code

// print the roles of the current user for ( String role : ADFContext.getCurrent().getSecurityContext().getUserRoles() ) { System.out.println("role "+role); } // get the ADF security context and test if the user has the role users SecurityContext sec = ADFContext.getCurrent().getSecurityContext(); if ( sec.isUserInRole("users") ) { } // is the user valid public boolean isAuthenticated() { return ADFContext.getCurrent().getSecurityContext().isAuthenticated(); } // return the user public String getCurrentUser() { return ADFContext.getCurrent().getSecurityContext().getUserName(); } // get the binding container BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry(); // get an ADF attributevalue from the ADF page definitions AttributeBinding attr = (AttributeBinding)bindings.getControlBinding("test"); attr.setInputValue("test"); ...

getting lov selected value in adf

Use the following method for getting the selected value of a LOV Component. private String getDrpDwnValue (String voIterator , String columnName , String rowIndex ){ String drpDwnValue = ""; try { DCBindingContainer bindingsOperand = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry(); DCIteratorBinding voIterBinding =bindingsOperand.findIteratorBinding(voIterator); Row voIterRow = null; if((rowIndex==null)||(rowIndex.equals(""))){ voIterRow = voIterBinding.getCurrentRow(); } else{ voIterRow = voIterBinding.getRowAtRangeIndex(Integer.parseInt(rowIndex)); } drpDwnValue = (String)voIterRow.getAttribute(columnName); } catch (Exception e) { // TODO: Add catch code e.printStackTrace(); } return drpDwnValue; } Input parameter to this method are voIterator -> it...

The file store "WLS_DIAGNOSTICS" could not be opened

WLS_DIAGNOSTIC ERROR weblogic.store.PersistentStoreException: [Store:280073]The file store "WLS_DIAGNOSTICS" could not be opened because it contained a file with the invalid version 1. A file of version 2 was expected. When you get this error while running your application on internal weblogic server delete the following file WLS_DIAGNOSTICS000000.DAT search the file in following path C:\jdev_work\system11.1.1.5.37.60.13\DefaultDomain this file is in DefaultDomain folder of your jdev. and delete the WLS_DIAGNOSTICS000000.DAT file . and run your applicatuon

Filters are not working in ADF Table

Usually when we use the filter table in adf  , some time it will not work and when you use the new criteria it display result of existing filter criteria so call the following method to work filters in your page use the following method to work your filters proper   public void resetPerfectedTableFilter()         {      FilterableQueryDescriptor queryDescriptor =  (FilterableQueryDescriptor) getPerfectedCaseTable().getFilterModel();             if (queryDescriptor != null &&  queryDescriptor.getFilterCriteria() != null)             {    queryDescriptor.getFilterCriteria().clear();                 getPerfectedCaseTable().queueEvent(new QueryEvent(getPerfectedCaseTable(),                                   ...

Trigger-Cursor example

CREATE OR REPLACE TRIGGER LOG_AUDIT_TRIGGER AFTER   INSERT OR UPDATE ON DEV2_APP.CASES   --table name on which u want to fire a trigger   REFERENCING OLD AS OLD NEW AS NEW   FOR EACH ROW     --WHEN (new.case_status_code<>old.case_status_code)   DECLARE                                                            -- variable declaration     n_status VARCHAR2(5) ;     o_status varchar2(5);   --n_status_reason varchar2(50) ;   n_modified_date DATE;   n_modified_user VARCHAR2(20);   o_caseId          VARCHAR2(20);   l_changeid      NUMBER; -- curser body or defination   CURSOR c_getmax_changeid(caseid VARCHAR2,field_name VARCHAR2)   IS     SELECT MAX(CA.change_id) AS maxChangeId ...

Oracle ADF Button Properties

< af:commandButton > Events javax.faces.event. ActionEvent : Invoke Application ,Apply Request Values. Event delivered when the "action" of the component has been invoked; for example, by clicking on a button. The action may result in page navigation. org.apache.myfaces.trinidad.event. ReturnEvent  : Apply Request Values Event delivered when the dialogue has completed successfully. org.apache.myfaces.trinidad.event. LaunchEvent  : Invoke Application,Apply RequestValues Event delivered to prompt the command to launch a dialog. org.apache.myfaces.trinidad.event. AttributeChangeEvent :  Invoke Application,Apply Request Values Event delivered to describe an attribute change. Attribute change events are not delivered for any programmatic change to a property. They are only delivered when a renderer changes a property without the application's specific request. An example of an attribute change event might include the width of a column that ...