Skip to main content

Posts

Showing posts from July, 2017

Font Awesome with ADF

For people who are not aware of Font Awesome , it  gives you scalable vector icons that can instantly be customized — size, color, drop shadow, and anything that can be done with the power of CSS. Their whole icon library is based on CSS not Images. Recently, we had to build a tree table based on Webcenter content's folder and file structure. And we needed to show proper icons for files (pdf, word etc.) and folders. Which should look like this   We choose Font Awesome, because it is scalable and easy to use. But front-end was ADF, so we were a bit sceptical  about how to integrate both. Turned out it was quite easy. Special thanks for Casper Overweter to do the implementation. 1. Create an ADF Skin : Create a custom skin, via New > Gallery. Base it on alta-v1 skin. 2. Download Font Awesome : Download the zip form their website . It's free. Unzip it inside the "customSkin" folder. Next to your CSS. 3. Extend Font Awesome to your c

Column Sorting in ADF TreeTable

Sorting of columns are not supported in ADF TreeTable by default.  The documentation of 12c says : Unlike the Table, the TreeTable does not support automatic sorting. The underlying TreeModel must support sorting by implementing it's sorting logic in the  setSortCriteria(List criteria)  method of the TreeModel. But my client wanted sorting on the tree table on few columns. It was a good challenge and this is how I solved it. Steps : 1. The treeModel is based on a managed bean. You cannot have the tree based on ADF-BC bindings. Simply because you need to override setSortCriteria(). 2. Added a few Comparators required for sorting of the columns. Assumptions : 1. Code is in Java 8, using one of the lamda methods of Collections. Lets get into the implementation details 1. Tree is based on a simple POJO.  public class UCMContent {          // tree hierarchy in the list of child     private List<UCMContent> children = new ArrayList<>();