Difference in RowCount Vs EstimatedRowCount Vs FetchedRowCount in ADF

Being an ADF developer,there are few method which is very confusing .So lets discuss method which fetch row count of VO>
Sometimes in ADF applications, we need to count the number of rows, as shown in the table .If we don’t understand these method , it will create a big performance problem.

getRowCount() -> getRowCount() retrives all the records from View Object by executing ViewObject Query.The count is calculated by traversing the Viewobject using next() method until the
last record is retrived. This method hinders the performance of application in case of VO with large number of rows.

getEstimatedRowCount() -> When you need to get quick count of row.Use this method. Method getEstimatedRowCount() actually retrives the count by hitting getQueryHitCount() which runs the select count(*) on the VO query.

getFetchedRowCount() -> Method getFetchedRowCount() counts the number of rows from the Result Set.Returns the number of rows fetched at that point of time.

In Short –

-> When you need to iterate all row to get or check some attribute value use getRowCount().It can create problem issue.
-> When you just need an count of table use getEstimatedRowCount().

If the application, we need to traverse the rowset all records, such as some of the above every line to get attribute values, you can choose to use getRowCount () method;
And if we only need to know the number of rows set the time, then use getEstimatedRowCount () method,

Re-order UI Componets using managed bean in Oracle ADF

Requirement – Re ordering of UI component using java code. Seems to be little tricky.

Solutions – Well , yes you can achieve that.For example, you are working on UI design in which you need to display two table inside panelGroupLayout.

PanelGroupLayout
Table 1
Table 2

Now you want on some condition , it should be like

PanelGroupLayout
Table 2
Table 1

public void yourCustomMethod() {

        FacesContext facesContext = FacesContext.getCurrentInstance();
        UIViewRoot root = facesContext.getViewRoot();
        RichTable table1 = (RichTable)root.findComponent("table1");
        RichTable table2 = (RichTable)root.findComponent("table2");
        
        RichPanelGroupLayout pgl1 = (RichPanelGroupLayout)root.findComponent("pgl1");

        MoveChildComponentChange change = new MoveChildComponentChange(table2,pgl1,table1);
        change.changeComponent(pgl1);
        
        AdfFacesContext.getCurrentInstance().addPartialTarget(pgl1);
        
    }

For more understanding read this – http://docs.oracle.com/cd/E15051_01/apirefs.1111/e10684/oracle/adf/view/rich/change/MoveChildComponentChange.html

Author – Ankit Gupta

Happy Coding with Techartifact …..

wraping text in outputText in Oracle ADF

Requirement- Wraping long text in outputText

Solutions- Many developer find solution to convert to input text and make read only.But that is just a work around.
Try this in inline Style – width:180px;display:inline-block;word-wrap:break-word
make nowrap property to false.

wrap


That’s it.

Happy coding with Vinay Kumar in techartifact….