cancel
Showing results for 
Search instead for 
Did you mean: 

More tableview issues

Former Member
0 Kudos

OK, today is tableView problems day. Here's another one:

I have a table containing entries that are dynamically created, based on what the user selects in another table (in my case, it's roles per usergroup; this info is stored in a custom-made table). The concept I'd like to try, is this: Whenever a user specifies certain criteria on my web page, I'll create a range of entries for my tableView. These entries should be marked as initially selected, so that the user can manually de-select the entries he doesn't want to keep before clicking the "Save"-button.

The following code was culled from another BSP forum posting, but doesn't work:

(onInputProcessing event)

...

describe table wt_roles lines wa_lines.

refresh keyTable. clear keyTable.

loop at wt_roles into wa_roles.

concatenate wa_roles-subsystem wa_roles-agr_name

into key.

append key to keyTable.

endloop.

CL_HTMLB_MANAGER=>CHECK_TABLEVIEW_ALL_ROWS( rowcount = wa_lines

request = request

id = 'wt_roles'

keyTable = keyTable

check = 'X' ).

The problem is that the number of selected entries seem to correspond with the "previous" number of entries in the table (ie. from the previous roundtrip). Example: If the table previously contained 3 entries, and the user generates new table content which is 10 entries, the above code will mark only 3 of them as selected even though the keyTable has 10 entries...

Trond

Accepted Solutions (1)

Accepted Solutions (1)

maximilian_schaufler
Active Contributor
0 Kudos

Hi Trond,

if I got your problem right it comes down to this:

With CL_HTMLB_MANAGER=>CHECK_TABLEVIEW_ALL_ROWS you only access the tableview that got submitted by the last HTTP request, therefore you will notice it will only effect this previous number of rows.

The new tableview with the updated data will only be generated once the view/page is processed, so it is not accessible via the cl_htmlb_manager (because there is only the old one).

However, you can add this attribute to your htmlb:tableView element:

...
selectedRowKeyTable  = "<%= keyTable %>"
...

Just add this attribute whenever you would like to have your pre-selection in the table.

Cheers,

Max

Answers (0)