I have not been blogging a lot lately. Several of my colleagues have checked on me, to see whether I was doing ok, as such a lull in blogging is uncommon. There are two main reasons for my absence from the blogging scene: first of all I had to finish three-and-a-half presentation for the ODTUG 2007 Kaleidoscope conference, starting very soon now and second of all, I have been working on the Holy Grail for data oriented user interface developers: the matrix. We have done it in Forms, we have done in SQL and now I had to do it in ADF Faces: create a matrix where both Columns and Rows are dynamic data – the masters – and the cells represent the intersection between the masters. For one of the products we are developing, we needed such a matrix. Not just for read-only presentation but also for data entry. And while we are at it: make it as generic as possible, so we can easily reuse it in many different places.
Well, it was a nice challenge. And it turned out to be not so enormously difficult as I had originally thought it would be. It just takes getting out of the frame (of mind), thinking outside the box and letting go the certainties of Component Drag and Drop.
Here we see an example of the Matrix Component – this one in read only mode – where we see the Department master-records turned into Columns and the Details – in this case Job Count records for each department – turned to rows. This representation is the alternative for
this one, that I created using standard drag & drop:
Turning such as Master-Detail into a matrix is now a piece of cake, using the generic Matrix component that I worked on – quite hard I might add.
As soon as all details are wrinkled out, I will write more about this component. If you are interested in using it, please let me know. Note that we are still deciding on whether to just publish it for all to use for ask for a contribution – as a lot of work went into this component – the one with editable cells, client side row and column summation, multiple cells per column etc.
I would like to do like this in my project, please give me more detail how to do that. I am a beginner for JDeveloper. Thank you in advance.
We’ve run into the same customer requirement for our ADF Faces Application and we’ve resolved this issue in our binding layer, so the complexity of the component is kept transparently. We’re using Toplink and EJB as our Business Logic-layer and Persistence-layer and we’ve defined a collection of ‘matrix-components’ that does the trick for us, meaning that we’ve created row-object using master-detail data to be able to show them in a matrix-view.
Why did we do this, because no component was available in ADF to build this matrix ‘rapidly’ and ‘easily’ and because we need to perform operations on this matrix-data as well which can be handled in easy way now because we’ve defined a proper model- and bizzlogic-layer for this.
A matrix-component does come in handy but the question is, where do you need to put this complexity, isn’t it better to keep the client interface as clean as possible and to adjust your model- and bizz-logic layer? JSF as such uses a complex refreshing cycle and adding complex components to this framework could lead to weard behaviour wright? Maybe ‘the matrix’ is an enhancement that needs to be looked at by the JDev Development Team because, as you stated, it’s a very complex and time-consuming component to work-out.
At this point rows are added when upon a refresh/requery new rows are found – for example new Job values in the EMP table in this example. The editable matrix at this point has editable cells – and entering a value in an empty cell is equivalent to inserting a new record in the database. The rows are determined by the results of a query. Clearing the value in a cell could be made to delete the record from the database; at the moment that is not implemented, but is fairly easy to do.
At some later stage I will allow the the user to create new rows by selecting a value for the row label from a drop downlist and perhaps also free format. I will add screenshots shortly – however, I first have to integrate the matrix in the product we are about to release a new edition of.
Lucas
Is it possible to add/remove/update rows in the editable mode of the matrix? If so, can you provide some screenshots; fully manageable tabular data (live) is a bit of a design problem – i’ve to agree!
LOL. Yep, you missed out on your 1 blog / per day routine…
😉