cancel
Showing results for 
Search instead for 
Did you mean: 

Assignment block with configTable: some questions

Former Member
0 Kudos

Hi all,

I've created a new assignment block with a configtable but i'm having some troubles.

1) How can i get the index of the selected row? My selected_index on my context is always empty...

2) How can I hide a column using the getters/setters on the context attributes?

Here is the layout of my view:

<%@page language="abap" %>

<%@extension name="chtmlb" prefix="chtmlb" %>

<%@extension name="thtmlb" prefix="thtmlb" %>

<%

DATA:

lv_editlist TYPE string,

lv_displaymode TYPE string.

IF controller->view_group_context->is_view_in_display_mode( controller ) = abap_true.

lv_editlist = 'FALSE'.

lv_displaymode = 'X'.

ELSE.

lv_editlist = 'TRUE'.

lv_displaymode = ' '.

ENDIF.

%>

<chtmlb:tableExtension tableId = "ttntable"

layout = "FIXED" />

<thtmlb:areaFrameSetter toolbarButtons = "<%= controller->gt_button %>"

maxButtonNumber = "1"

displayMode = "<%= lv_displaymode %>" />

<chtmlb:configTable id = "Table"

navigationMode = "BYPAGE"

onRowSelection = "select"

table = "//RegNode/Table"

width = "100%"

allRowsEditable = "TRUE"

headerVisible = "FALSE"

personalizable = "FALSE"

downloadToExcel = "FALSE"

actionsMaxInRow = "6"

hasLeadSelection = "TRUE"

selectionMode = "<%= RegNode->SELECTION_MODE %>"

selectedRowIndex = "<%= RegNode->SELECTED_INDEX %>"

selectedRowIndexTable = "<%= RegNode->SELECTION_TAB %>" />

Accepted Solutions (1)

Accepted Solutions (1)

yevgen_trukhin
Advisor
Advisor
0 Kudos

Hello Guy,

1) Where do u try to access it and what do you want to do with it? For example, doing get_current on collection_wrapper which is the basis of the table will return the selected row (if it is single select table) and if it is multi-select, you can do get_marked on the collection wrapper.

2) No, i dont think you can achieve that. However, if you implement an iterator for the table, you will be able to add/remove columns dynamically.

Best Regards,

Yevgen

Former Member
0 Kudos

Hi Yevgen,

First of all thanks for your reply!

1) when I select multiple rows in the table and I press on a button to trigger an event,

lr_col = typed_context->regnode->collection_wrapper->get_marked( ) is always 0; even though I see multiple rows marked in the table... Any idea?

2) is it possible to add an iterator to a table like <chtmlb:configTable >?

What type should the attribute 'iterator' have?

Many thanks!

CarstenKasper
Active Contributor
0 Kudos

Hi,

in a normal case there should be one method implemented on the IMPL class. The name is EH_ONSELECT.

Put a breakpoint there and make sure it is called, a similar method is on the context node. It should be called in the EH_ONSELECT.

An additional note: Have a look at the DO_INIT_CONTEXT method what kind of selection mode is set for your table. If this is not set, try setting it to SELMODE_SINGLE or SELMODE_MULTI.

cheers Carsten

yevgen_trukhin
Advisor
Advisor
0 Kudos

Hello Siegfried,

1) As Carsten mentioned, check for selection mode of your table, it should be enabled. For sample implementation, check component IUICPRP, view ProductProposal.

2) Yes it is possible to add. Check component IUICOVW, view AccContract for sample implmentation of the iterator.

Best regards,

Yevgen

Answers (0)