cancel
Showing results for 
Search instead for 
Did you mean: 

Table Ui element

Pramanan
Active Participant
0 Kudos

Hello Experts,

I have kept a table ui element in a view which is displayed as popup. At run time i cannot select the table header.

i have clicked the table header to select row but its not working.

can anybody please tell me how to resolve this problem.

Thanks

Accepted Solutions (0)

Answers (2)

Answers (2)

Pramanan
Active Participant
0 Kudos

answered

Former Member
0 Kudos

Hi,

Did you implement an event handler method for LeadSelction in the view or not.If not create an action for LeadSelection of your table.

Pramanan
Active Participant
0 Kudos

Dear Suman,

i have implemented event handler method for leadselection.But its not working.

By default if we click on the header it will select the whole row and differentiate it with some colors.In my popup that default property itself is not woking.

Former Member
0 Kudos

Hi,

Put the brak point in that event handler method and check when click the lead selection wheather it is triggering or not.

By default if we click on the header it will select the whole row and differentiate it with some colors.In my popup that default property itself is not woking.

That means you unchecked the initialization Lead Selection of context node.

Pramanan
Active Participant
0 Kudos

Dear suman,

could you please give me suggestion to acheive the below scenario.

I have a Delete button on the tool bar of a table.If any of the row is selected, then it should be highlighted and the selected row should be deleted if the delete button is pressed.

I checked the intialization lead selection and so the first row which is by default get selected and can be deleted.But random deletion is not possible.

Former Member
0 Kudos

Hi Ramanan,

Check a few things before you continue on any solution:

For the context node mapped to the table UI

The property Selection is set to the right cardinality (depending on if single or multiple rows need to be selected)

You need not check the Initialization Lead Selection here. Checking it implies that by default, the first row of the table UI is always highlighted (or in other terms selected)

For the Table UI Element

The property rowSelectable is checked

On click of the Delete button, make sure you get the element which was lead selected and process that element for deletion.


  DATA: lo_element TYPE REF TO if_wd_context_element.
  CALL METHOD wdevent->get_context_element
    EXPORTING
      name  = 'CONTEXT_ELEMENT'
    RECEIVING
      value = lo_element.

Best Regards,

Rashmi.

Pramanan
Active Participant
0 Kudos

Hi Rashmi,

cardinality property is set as o..n and selection as 0..1.Lead selection initialization property is unchecked for this node. Also i took the current row in a structure for deletion and pass it.

But the selection is not woking (nothing is highlighted when clicked the row header) .

DATA l_atta_id TYPE swo_typeid.

data lt_messages type bapirettab.

DATA:

node_attachments TYPE REF TO if_wd_context_node,

elem_attachments TYPE REF TO if_wd_context_element,

stru_attachments TYPE if_ZTRARECEIPT_VIEW=>element_zattachments .

node_attachments = wd_context->get_child_node( name = if_ZTRARECEIPT_VIEW=>wdctx_zattachments ).

elem_attachments = node_attachments->get_element( ).

IF elem_attachments IS INITIAL.

RETURN.

ENDIF.

  • get all declared attributes

elem_attachments->get_static_attributes(

IMPORTING

static_attributes = stru_attachments ).

Always elem_attachments is initial.

Former Member
0 Kudos

Hi Ramanan,

Your code is correct nothing wrong there.I think you are doing something wrong with get_child_node.

do in this way.

1.put the break point at this line and check the node has values or not.

node_attachments = wd_context->get_child_node( name = if_ZTRARECEIPT_VIEW=>wdctx_zattachments ).

write the above statment in this way and check the value.

node_attachments = wd_context->get_child_node( 'ATTACHEMENTS' ).

let me know if your problem is not solved.

Pramanan
Active Participant
0 Kudos

Hi suman,

Actually i am referring to ZATTACHMENTS in ZTRARECEIPT_VIEW. If i checked lead selection initilization option its deleting the first row when i click Delete button.But i want to delete any row by selecting the row and click on button.

Former Member
0 Kudos

Hi Ramanan,

I understood your requirement.but i dont understand your words below.

Actually i am referring to ZATTACHMENTS in ZTRARECEIPT_VIEW

Did you do what i suggested or not.

here attchments means node name.

node_attachments = wd_context->get_child_node( 'ATTACHEMENTS' ).

Edited by: suman kumar chinnam on Oct 16, 2008 11:46 AM

Pramanan
Active Participant
0 Kudos

hi,

I have zattachements node and no child node like attachments.

Former Member
0 Kudos

Hi,

I dont know your node name right? that was just my suggestion .Any how write your code like this way.

node_attachements = wd_context->get_child_node( 'ZATTACHMENTS' ) .

put the break point at above atatement and check whether you are getting reference of your node into variable or not on click of Lead selection.

Pramanan
Active Participant
0 Kudos

Hi,

No its initial.The selected row is not highlighted , so i think its not getting reference.

Any idea to solve this.

Former Member
0 Kudos

Hi,

I already asked you that are you getting node reference or not and check lead selection intialization of context node.

You can also try in this way.

data:node_flights type if_wd_context_node,

it_flights type if_main=>elements_flights,

ls_flights like line of it_flights,

v_index type sy-index.

node_flights = wd_context->get_child_node( 'FLIGHTS' ).

CALL METHOD LO_ND_FLIGHTS->GET_LEAD_SELECTION_INDEX

RECEIVING

INDEX = v_index.

CALL METHOD LO_ND_FLIGHTS->GET_STATIC_ATTRIBUTES_TABLE

IMPORTING

TABLE = it_flights.

read table it_flights into ls_flights index v_index.

now the work area contains values of your selected row.

Pramanan
Active Participant
0 Kudos

hi,

it shows error in Read statements. As Read statement is not possible in OO.

Former Member
0 Kudos

Hi,

I am not getting any errors i checked perfectly,problem with your coding only.Try to check again declaration of internal table and work area, just use code wizard to read the context then automatically it will give internal table and structure.

I am pasting my code again check properly.

DATA: lo_nd_flights TYPE REF TO if_wd_context_node,
       lo_el_flights TYPE REF TO if_wd_context_element,
       ls_flights TYPE wd_this->element_flights,
       it_flights type table of wd_this->element_flights,
       v_index type sy-index.
* navigate from <CONTEXT> to <FLIGHTS> via lead selection
  lo_nd_flights = wd_context->get_child_node( name = wd_this->wdctx_flights ).

 CALL METHOD LO_ND_FLIGHTS->GET_LEAD_SELECTION_INDEX
   RECEIVING
     INDEX  = v_index.

 CALL METHOD LO_ND_FLIGHTS->GET_STATIC_ATTRIBUTES_TABLE
   IMPORTING
     TABLE  = it_flights.

  read table it_flights into ls_flights index v_index.

Pramanan
Active Participant
0 Kudos

hi suman,

But still i cannot select any row in the table.

Former Member
0 Kudos

Make sure that 'RowSelectable' property is CHECKED.