3 Replies Latest reply on Apr 29, 2012 8:55 AM by Jan Vervecken

    iter.setCurrentRow strange behavior

    ILya Cyclone
      Hello,
      Using ADF BC and experiencing some strange programmatic iterator behavior

      RequestScopeBean code:
      Key key = new Key(new Object[] { idComponent, idProjectKey });
      _logger.finest("key = " + key);
      String keyString = key.toStringFormat(true);
      
      DCIteratorBinding iter = ADFUtils.findIterator("ProjectIndicatorsView1Iterator");
      iter.setCurrentRowWithKeyValue(keyString);
      _logger.finest("iter.getCurrentRow() = "+iter.getCurrentRow());
      Row row = iter.findRowByKeyString(keyString);
      _logger.finest("find row = "+row);
      Output:
      <ValueBean> <createOrEditProjectIndicators> key = oracle.jbo.Key[1605 1003 ]
      <ValueBean> <createOrEditProjectIndicators> iter.getCurrentRow() = ViewRow [oracle.jbo.Key[1646 1003 ]]
      <ValueBean> <createOrEditProjectIndicators> find row = ViewRow [oracle.jbo.Key[1605 1003 ]]
      As you see I create a key [1605 1003] and set iterator's current row with it. Than I check iterator's current row, but it is [1646 1003].
      After that I try to find row with the same key and row [1605 1003] is found.

      In DataModel this iterator has no parent, no criteria applied, and row [1605 1003 ] is really there.

      What's the reason of such behavior?

      Thanks.
      ADF 11.1.2.1

      Edited by: ILya Cyclone on Apr 28, 2012 4:40 PM
        • 1. Re: iter.setCurrentRow strange behavior
          Jan Vervecken
          hi ILya Cyclone
          ILya Cyclone wrote:
          ... As you see I create a key [1605 1003] and setting current row with it. ...
          Which statement sets the current row?

          - about your call to findRowByKeyString() see the documentation
          at http://docs.oracle.com/cd/E24382_01/apirefs.1112/e17483/oracle/adf/model/binding/DCIteratorBinding.html#findRowByKeyString%28java.lang.String%29
          that says "For internal use only. Application developers should not use this "

          regards
          Jan Vervecken
          • 2. Re: iter.setCurrentRow strange behavior
            ILya Cyclone
            Oh, thanks, missed a row while copying:
            iter.setCurrentRowWithKeyValue(keyString);
            • 3. Re: iter.setCurrentRow strange behavior
              Jan Vervecken
              hi ILya Cyclone
              ILya Cyclone wrote:
              Oh, thanks, missed a row while copying:
              iter.setCurrentRowWithKeyValue(keyString);
              The documentation for the method setCurrentRowWithKeyValue()
              at http://docs.oracle.com/cd/E24382_01/apirefs.1112/e17483/oracle/adf/model/binding/DCIteratorBinding.html#setCurrentRowWithKeyValue%28java.lang.String%29
              says "... This method only works for cases where there's one key attribute on the collection.".

              regards
              Jan