Posts

Showing posts from July, 2010

A short cut to display row numbers for each record on UI

In this post, I'm sharing a tip to display row numbers along with data in each row on UI. Idea is to modify the ViewObject's query to use ROW_NUMBER(). You may need to be measured if the number of records in the table are large in size (because of the obvious performance issues). SQL for a typical ViewObject may look like as shown below, SELECT ROW_NUMBER() OVER(ORDER BY Employees.FIRST_NAME)AS ROW_NUMBER , Employees.EMPLOYEE_ID, Employees.FIRST_NAME, Employees.LAST_NAME, Employees.EMAIL, Employees.PHONE_NUMBER FROM EMPLOYEES Employees You can download the sample workspace from here . [Runs with Oracle JDeveloper 11g R1 PS2 + HR Schema]

Tips on using <af:panelCollection>

Image
A couple of tips on using <af:panelCollection> 1. Use space delimiter if you want to turn off multiple 'default features' for the <af:panelCollection> Example: <af:panelCollection id="pc1" featuresOff="detach freeze wrap" > 2. If you don't want the end user to hide specific columns using the 'View->Columns' option, set showRequired="true" for those columns. This setting will disable the columns in the 'View' menu.

Enabling LOVs for Dynamic ViewObject attributes

Image
In one of my previous posts , I talked about the model driven approaches for building dynamic User Interfaces. This post is in continuation of the earlier post. This time, I'll discuss about building ' Dynamic Form ' containing LOV(List of Values) enabled fields (built using dynamic ViewObject). Defining Dynamic Entity Objects and View Objects First step is to to build EntityObject and corresponding ViewObject dynamically, based on the meta-data supplied by the run time. Below given sample code illustrates the APIs used for building EntityObjects and corresponding ViewObject, on the fly. EntityDefImpl newEntity = new EntityDefImpl(DYNAMIC_EO); AttributeDefImpl newAttrDef1 = newEntity.addAttribute("DepartmentId", "DEPARTMENT_ID", Number.class, false, false, true); //Other attribute defn goes here... newEntity.resolveDefObject(); newEntity.registerDefObject(); ViewDefImpl newView = new ViewDefImpl(DYNAMIC_VO); newView.addEntityUsa...

Running ApplicationModule using an external JDBC connection

Image
Use case This post discusses a bit odd use case. This requirement arose while migrating a huge system built on Java to ADF technology stack. When choosing modules for migration(in a step by step manner), there are chances that a specific service may need to compose business methods from existing legacy system and newly build ADF BC modules. Now the fun starts, functional testing team may not be aware of the underlying migration phases. So there may be cases where existing java code and partially migrated ADF BC modules needs to participate in the same database transaction. This is an easy task if the existing system is based on XADataSource to access database. You may just need to make sure that your ApplicationModule is configured to use the same XADatasource. What if that's not the case? You may need to share same raw JDBC Connection between two implementations. This post discusses a possible solution for this scenario. Please note that, I'm not recommending this appro...