Monday, 12 September 2016

ADF : Reset or clear transient attribute manually

ADF : Reset or clear transient attribute manually

public void updateMappedFlag(){
        ViewObjectImpl mapColumnVo =
                   (ViewObjectImpl)this.findIterator("FileImportMapColumnsIterator").getViewObject();
        OAViewObjectImpl attrVo =
                   (OAViewObjectImpl)this.findIterator("FileImportAttrForObjectDetailForMapFieldsPageIterator").getViewObject();
        RowSetIterator attrRSI = attrVo.getRowSetIterator();
        RowSetIterator mapsRSI = mapColumnVo.getRowSetIterator();
        Row[] mapColRows = mapColumnVo.getAllRowsInRange();
        int count = 1;
        long attrRowCount = 0;
        attrRowCount = attrVo.getEstimatedRowCount();
        int mapColumnRowCount = 0;
        mapColumnRowCount = (int) mapColumnVo.getEstimatedRowCount();
       
       
        attrRSI.reset();
        attrVo.clearCache(); 
       
       
        //testing
        for(int i=0; i< mapColRows.length; i++){
                    Row mapColumnRow = mapColRows[i];
                    String sourceAttr = (String) mapColumnRow.getAttribute("ImpFieldName");
                    String objColDispName = (String) mapColumnRow.getAttribute("ObjColDisplayName");
                    String sourceMapped1 = (String) mapColumnRow.getAttribute("IgnoreFieldFlag");
                    if(objColDispName != null && !"".equalsIgnoreCase(objColDispName)){
                            Row[] attrRows = attrRSI.getFilteredRows("ObjectAttrName", objColDispName);
                            if(attrRows != null && attrRows.length == 1){
                                Row attrRow = attrRows[0];
                                if(attrRow != null){
                                    attrRow.setAttribute("Mapped", "Y");
                                }
                            }
                                
                    }
                    
            }
        //end

        mapsRSI.closeRowSetIterator();
        attrRSI.closeRowSetIterator();

            AdfFacesContext.getCurrentInstance().addPartialTarget(this.panelGL);
     
    }



Thursday, 1 September 2016

ADF :BC : af:quickQuery component .. viewcriteria not able to retain the value in memory

ADF :BC : af:quickQuery component .. viewcriteria not able to retain the value in memory



Solution




    @Override
    public void executeQuery()
    {
        this.setQueryMode(ViewObject.QUERY_MODE_SCAN_DATABASE_TABLES | ViewObject.QUERY_MODE_SCAN_VIEW_ROWS);
        super.executeQuery();
    }

ADF :BC : transient attribute always value should populate from getter logic method

ADF :BC : transient attribute always value should populate from getter logic method


Transient attribute populated through programmatically, if you do executeQuery() the value of transient attribute will vanish.
Always populate transient attribute value from getter logic method or expression.





Solution


Way 1 : If possible write the logic in getter method of transient attribute.

Way 2 : After Search repopulate the “Y” programmatically in transient attribute as shown below.