Skip to Content
author's profile photo Former Member
Former Member

Personas 3.0: pick up arbitrary lines selection from a very long table with scrolling

Hi Personas 3.0 experts,

This looks like a simple issue - but the general solution is not simple, why I am looking for a better answer.

Problem:

On UI there is a table with many rows, say 12 rows, but the screen can only display 3 max rows. To view all rows user has to scroll the table.

Action:

User needs to select multiple rows at any places (user can scroll the table if needed). A button is used to show all the selected row index (which should be the absolute index of the table).

Say, user can select rows of absolution index 2,11

Issue:

One a given screen, the absolute index=(value of tbl.selectedRows) + tbl.firstVisibleRow;

But tbl.selectedrRows returnx a STRING of relative index, say, "1;3" which must be parsed into a number array [1,3]. These are numbers of relative index depending on the offset, tbl.firstVisibleRow which has a changing value while user scrolling.

The problem is that this changing offset is not saved anywhere during scroolling. It is impossible to calculate the absolute index afterwards. I am just feeling that it should not be so complicated for such simple usecase.

Maybe there is a better way of doing this, anyone knows? Thanks!

Dong Zhu

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Aug 12, 2016 at 02:23 PM

    Hi Dong,

    We have introduced a new property called selectedRowsAbsolute with SAP Screen Personas 3.0 SP03. The existing selectedRows property is deprecated with SP03. The selectedRowsAbsolute property is slightly different for GuiTableControl and the GuiGridView objects. You can find more information in the API documentation using the URL:

    http(s)://<hostname>:<port>/sap/bc/personas3/core/resources/doc/PersonasScriptingAPIDoc.html?sap-client=<client>

    I have included the information below for your reference:

    GuiGridView:

    selectedRowsAbsoluteStringrwThis property represents the selected rows of the table.
    It is a concatenation of row indexes (0-based) or index ranges separated by semicolon in arbitrary order. Ranges follow the format "<lower number>-<higher number>". Example: "2;5-7;1;23;9-11".
    The row index numbers in this string are relative to the entire set of rows meaning the numbers span from 0 to rowCount-1.

    GuiTableControl:

    selectedRowsAbsoluteStringrwThis property represents the selected rows of the table. In GuiTableControl (unlike in a GuiGridView control) this property only represents the selected rows that are currently visible. There may be other selected rows which are outside of the current scroll area and therefore excluded from this property. If information of the selection state of currently not visible rows is needed, then is is necessary to "scroll" to the invisible rows by setting the firstVisibleRow property before reading the selectedRowsAbsolute property.
    It is a concatenation of row indexes (0-based) or index ranges separated by semicolon in arbitrary order. Ranges follow the format "<lower number>-<higher number>". Example: "2;5-7;1;23;9-11".
    The row index numbers in this string are relative to the entire set of rows meaning the indices span from firstVisibleRow to (firstVisibleRow+visibleRowCount-1).

    For GuiTableControl control, the selection is possible only within the visible range of rows.

    Best regards

    Kranthi

    SAP Screen Personas Team

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Kranthi,

      Thanks for the info.

      Actually I just re-thought about my case and in most time, ie, user needs to select a few lines on Ui and press a button to take action. The .selectedRows propert will be OK as it only refers to the lines being displayed on the screen. If selected line is scrolled outside the window, this property won't count it. And if scrolls that line back, it will be counted by this property again.

      It worth noticing that the user's selection mark will stay on the line even outside the window. So in the case user needs to know how many lines including those outside the window have been selected, your new property will come to handy.

      Thanks.

      Dong Zhu

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.