Friday, April 12, 2013

Multiple Files Upload - Unlimited Files Upload in ADF 11g PS6

Among other new components and features available in ADF 11g PS6 - there is one very important. File Upload ADF Faces component was upgraded to support multiple or basically infinite file upload. This is good to see how ADF framework is progressing with each new release, this is another argument why you should use ADF.

I was using sample application - MultipleFileUpload.zip, to test how multiple file upload works. You drag and drop regular ADF Faces input file component:


There is option to set number of rows (number of files in other words) to be rendered by input file component (this number can be changed dynamically on runtime):


Another property that must be set - MaximumFiles. With this property you can specify maximum number of files to be uploaded at once (also can be changed dynamically on runtime):


This is about UI part. Now how to handle multiple files and how to get Input Stream. You can create Action Listener for Upload button and handle multiple files input from such listener:


Important part - if you plan to allow multiple files upload, you should bind ADF Faces input file component the List. In such way, we have access to collection of files user is uploading:


Lastly don't forget to set UsesUpload=true property as usual for the container JSF page on af:form tag:


Set UsesUpload=true property for af:form:


Here how it looks on ADF UI - multiple files are submitted to be uploaded (even file upload progress bar is rendered while file is being loaded):


Status on the server informs about successful multiple files upload:


Thursday, April 11, 2013

How To Control ADF Table Pagination on Runtime and Do Case Insensitive Search

I decided to update my sample app from previous post - ADF 11g PS6 - ADF 10g Table Pagination Feature is Back Finally with option to change page size dynamically on runtime. Change between scroll and page mode is implemented, plus case insensitive table column filter option is enabled. Updated sample - TablePaginationApp_v3.zip comes with choice list to select page size:


There is button to force page size change, it calls af:setPropertyListener:


Listener is copying selected page size from choice list and sets Range Size in table iterator. Table Fetch Size by default is set to be equal iterator Range Size - this is how we can change dynamically table page size:


FetchSize is equal table iterator Range Size:


Switch between scroll and page modes is implemented in backing bean - changing scroll policy and doing surrounding panel collection PPR:


By default, when table is loaded - 10 rows are displayed:


You can change to 25 rows:


Switch between scroll and page modes from panel collection menu:


Rendering scroll mode now - no option to change page size, all rows are displayed:


This is how we can control table layout.

Let's see how column case insensitive search works - this is just one property change for the af:column tag. Try to search for First Name - "steven":


There will be no results - by default case sensitive search is executed in ADF table:


How to enable case insensitive search for af:column - easy. Select af:column you want to apply case insensitive search:


Set "caseInsensitive" for FilterFeatures property of af:column:


Search again for "steven" - this time result is available:


Sunday, April 7, 2013

List View - Cool Looking ADF PS6 Component for Collections

I'm very excited about ADF PS6 release, it brings new freshness and coolness feeling to ADF. ADF Faces runtime performance seems to be incomparable faster and much more responsive comparing to previous ADF 11g R1 and even ADF 11g R2 releases. This gives good hopes to expect the same improvements in ADF 12c. There is new ADF Faces component introduced - List View. You can think about it as about much more liberal ADF Faces table component. List View renders data collections but there is much more control and flexibility how data collection is presented visually. If you need to render strict tabular data - ADF Faces table is the most suitable, List View is for something less structured. We could achieve up till now similar layout as List View with custom implementation using ADF Faces iterators or for each tags. Of course it is much easier now to use out of the box List View tag - Displaying a Collection in a List.

Here you can see fragment structure for my sample application with List View usage - ListViewApp.zip:


There are two types of List View implemented here - simple and hierarchical one. Simple List View renders collection in a list, there is option to load more rows from the collection on demand. Hierarchical List View renders Department - Employees master detail data:


Simple list is configured with the same property values as regular ADF Faces table:


Collection row is rendered within List View using List Item tag - this is where actual output or input ADF Faces component is implemented:


List View with editable popup functionality - launched from Edit button. Edited data is synchronized with data rendered in List View immediately:


Hierarchical List View is configured with the same properties as regular ADF Faces tree would be configured - pointing to treeModel instead of collectionModel as for the ADF Faces table. There is groupHeaderStamp facet - it allows to render data grouping:


Second level data is rendered under List Item tag:


In the page definition, there is regular tree collection definition as usual:


Hierarchical List View provides really good view of hierarchical data and it renders fast. Here viewing employees by departments:


One more small thing: I noticed in PS6 after session timeout - screen becomes black, looks good:


Tuesday, April 2, 2013

ADF 11g PS6 - ADF 10g Table Pagination Feature is Back Finally

Do you remember good old feature from ADF 10g - table pagination? So many customer requests I have heard to have it back in 11g and finally in ADF PS6 we have it. Not all good features mean bad, table pagination is perfect example. Some two years back I blogged sample application for custom table pagination like behavior - Oracle ADF 11g Custom Table Pagination.

Table pagination is out of the box in ADF 11g PS6:


Implementation steps are pretty simple. Firstly you should set scrolling policy to Page:


AutoHeightRows must be set to 0 and make sure that FetchSize is equal Range Size. FetchSize property determines how many rows are shows in single table page:


In this example I have set RangeSize = 10, this is how many rows are shown in table page:


Download ADF 11g PS6 sample application - TablePaginationApp.zip.

Update April 3rd, 2013:

Blog reader was asking if table pagination works in plain page - yes it works. Here is updated sample application - TablePaginationApp_v2.zip. Table with pagination is implemented directly inside main page, without any layout wrapping components, just below af:form:


Table pagination is rendered operational and without warnings in Google Chrome:


Work the same in IE:

Saturday, March 30, 2013

Red Samurai Performance Audit Tool - Up and Running

It's been some time since we created Red Samurai Performance Audit Tool in August, 2012. This tool was deployed and it was logging all performance related issues in one of the projects, already for 8 months. I thought to share with you how it goes, below you can see the results logged continuously from August, 2012 till now:


As project was growing and becoming more complex, performance was going down. But after complexity reached a peak and we were able to locate performance bottlenecks with audit tool for fixing - performance started to improve in the recent months.

Thursday, March 28, 2013

Oracle University Training - ADF/WebCenter Spaces 11g & BPM Suite 11g Integration

I will teach one more Oracle University training course, this time in Slovakia, Bratislava. Training will be about ADF/BPM/WebCenter integration and is scheduled for November 7th - 8th. You can get more details and registration on Oracle University site.

If you are interested in ADF/BPM integration topic - read my previous blog posts on this topic.

Wednesday, March 27, 2013

ADF Generator for Dynamic ADF BC and ADF UI - Recreate

Last year in November, I was blogging about ADF generator for dynamic ADF BC and ADF UI. This approach allows to generate ADF BC from metadata and draw ADF UI dynamically based on ADF BC structure. You can read more about it here. This approach works without issues. However, if you want to change dynamic ADF BC and redraw ADF UI while staying on the same fragment or page, there is special trick to recreate dynamic iterator declared in Page Definition. This trick is described in Duncan Mills blog - Refresh Problems using Adaptive Bindings, I will apply it to my sample app posted here.

Without this trick applied, if you try to change ADF BC dynamic VO - there will be error generated from ADF bindings:


Sample application - ADFDynamicReportUI_v2.zip, works better with the workaround applied. Just before ADF BC dynamic VO is changed, ADF bindings iterator is refreshed - this allows to reload ADF View based on changed ADF BC VO:


Iterator is defined in Page Definition, this is regular static iterator created out of predefined VO (later dynamically initialized, see my previous blog mentioned above). There is not table or attribute bindings, because I'm using ADF dynamic form component on the ADF UI:


Dynamic VO is constructed in AM Implementation class, based on parameter - different VO structure is created:


Different SQL statement is created:


It works now to switch to different VO structure - see the checkbox coming as part of recreated VO: