Sunday, April 1, 2012

Some cryptic thoughts on getting binding data via View Objects or RowImpl


       
//get the iterator ----------------------------
        BindingContext bc = BindingContext.getCurrent();
        DCBindingContainer binding = (DCBindingContainer)bc.getCurrentBindingsEntry();
        DCIteratorBinding iter = binding.findIteratorBinding("The_Iterator");


//get a View representation of the data via View Object   
         ViewObject voTableData = iter.getViewObject();


//get RowImpl representation via ViewRowClass
        RunTrendUVORowImpl aRowImpl;


// get the current Row
        Row theCurrentRow = voTableData.getCurrentRow();
        aRowImpl = (RunTrendUVORowImpl)voTableData.getCurrentRow();
// all the hitting the same data.        
        System.out.println("Daystweenpt: " + theCurrentRow.getAttribute("Daystweenpt").toString());
        System.out.println("Numdaysforavg: " + theCurrentRow.getAttribute("Numdaysforavg").toString());
        System.out.println("Rundate: " + theCurrentRow.getAttribute("Rundate").toString());
        System.out.println("RuntrendPk: " + theCurrentRow.getAttribute("RuntrendPk").toString());


        System.out.println("aRowImpl Daystweenpt: " + aRowImpl.getAttribute("Daystweenpt").toString());
        System.out.println("aRowImpl Numdaysforavg: " + aRowImpl.getAttribute("Numdaysforavg").toString());
        System.out.println("aRowImpl Rundate: " + aRowImpl.getAttribute("Rundate").toString());
        System.out.println("aRowImpl RuntrendPk: " + aRowImpl.getAttribute("RuntrendPk").toString());
        
        System.out.println("aRowImpl.get Daystweenpt: " + aRowImpl.getDaystweenpt());  
        System.out.println("aRowImpl.get Numdaysforavg: " + aRowImpl.getNumdaysforavg());   
        System.out.println("aRowImpl.get Rundate: " + aRowImpl.getRundate() );  
        System.out.println("aRowImpl.get RuntrendPk: " + aRowImpl.getRuntrendPk());

No comments:

Post a Comment