rbf_getMaxRowIndex2() doesn't give the correct number an

Posted by IramK on 04-Dec-2015 09:01

Hello,

In version 3.2.0.0., rbf_getMaxRowIndex2() used to return the correct maximum value for a row Index, however in version 4.0.2.0, this doesn't work the same. I've tried it in two scenarios:

If there are no rows in the grid

Version: 3.2.0.0.: returned 0 (correct)

Version: 4.0.2.0: returned -1 (wrong)

If there were 2 rows but then deleted them

Version 3.2.0.0: returned 2 (correct)

Version: 4.0.2.0: returned 1 (wrong)

Has this functions functionality been changed? Kindly let me know.

Cheers.

Iram

Posted by Sri Harsha on 07-Dec-2015 04:11

Hi Iram,

RowIndex was always 0 based and there was an issue with older getMaxRowIndex2() API call.

For example, if you use rbf_getGridValue2(0, 'myFieldName', 1) call in Classic UI, it returns the value from the second row and not the first row. So, rowIndex was always 0-based.

So, rowIndex remains the same in both Classic and New UI but the getMaxRowIndex() API returns the correct max rowIndex in New UI. You can be assured of that.  Also, i agree that the info that rowIndex is zero based is missed in the documenation. We shall take a note of it and do the necessary.

By the way,  the new documentation URL is documentation.progress.com/.../.  The one pointed before was on Classic UI. Going foward, please use this for reference.

Regards,

Harsha.

All Replies

Posted by Sri Harsha on 07-Dec-2015 01:33

Hi Iram,

Yes. The row-index is 0-based. So the first row is of index 0.

In the cases you mentioned below,

If there are no rows in the grid :-  

   >>    the api returns -1 because there are no rows.

if there were 2 rows but then deleted them:  

   >>    As documentation suggests documentation.progress.com/.../index.html rowIndex does not change on deletion of rows. So the api returns 1 (which means two rows of index 0 and 1 assigned respectively).

Regards,

Harsha.

Posted by IramK on 07-Dec-2015 03:17

Hello Harsha,

I have been looking at the documentation and I don't see anywhere where its written that the row index is 0-based.

documentation.progress.com/.../index.html

Moreover, so are you saying that the way it worked in version 3.2.0.0. was wrong? Could you confirm that to me? If that's the case, I would be happy to be assured that this function returns -1 (for no rows) and the actual index of the last row if there are any rows. Is that correct?

Cheers.

Iram

Posted by Sri Harsha on 07-Dec-2015 04:11

Hi Iram,

RowIndex was always 0 based and there was an issue with older getMaxRowIndex2() API call.

For example, if you use rbf_getGridValue2(0, 'myFieldName', 1) call in Classic UI, it returns the value from the second row and not the first row. So, rowIndex was always 0-based.

So, rowIndex remains the same in both Classic and New UI but the getMaxRowIndex() API returns the correct max rowIndex in New UI. You can be assured of that.  Also, i agree that the info that rowIndex is zero based is missed in the documenation. We shall take a note of it and do the necessary.

By the way,  the new documentation URL is documentation.progress.com/.../.  The one pointed before was on Classic UI. Going foward, please use this for reference.

Regards,

Harsha.

Posted by IramK on 07-Dec-2015 04:18

Ok thanks for confirming that it works correctly in the New UI. Also I just saw a similar post here: https://community.progress.com/community_groups/rollbase/f/25/t/21281

Cheers.

Iram

This thread is closed