cancel
Showing results for 
Search instead for 
Did you mean: 

Table Popin

roger_beach
Participant
0 Kudos

I have a WD component which has a view that contains a table. I have a popin in the table for each row which also contains a table. When toggling the popin for each row, the values for the popin populate just fine. However, part of the requirement was to add an expand/collapse all button to toggle the popins for all rows at the same time.

I currently have a test case where the main table has three rows of data. The popin table has four columns providing additional detail for the main rows. When I toggle the expand/collapse all, all the popins toggle open just fine, but the one for the first row only populates the first column in the popin and not columns 2-4. However, for main rows 2 and 3 of the table, the popins populate all 4 columns just fine.

While debugging, the values for the first row's table popin are populating in the node just fine, but at some point it loses them and I can't figure out where.

I have a method on the component controller called Define_Details which populates the popin, and again when toggling the popins individually per row, the values are just fine.

I have a method on the view called Onaction_expandall for the button expand/collapse all which controls opening the popins and also loops through all the elements and calls the method from the component controller to populate the values.

I appreciate any insight and thoughts as to why when toggling the expand/collapse all button, the first row populates only the first column in the popin but not the other three while all other rows populate all four columns.

[ScreenShot of Component|http://img14.imageshack.us/img14/1929/wdcomponent.jpg]

Edited by: Roger Beach on Nov 19, 2011 1:05 PM

Accepted Solutions (0)

Answers (1)

Answers (1)

roger_beach
Participant
0 Kudos

On further testing, it is not filling the details popin for whichever main row of the table is the lead selection. I originally had the following code but without index = lv_count for the context element and that made it only work for the row with lead selection. Adding the index to the context element seemed to sort things out except now it doesn't work completely with lead selection.

lv_count = 0.
  LOOP AT lt_elem_set ASSIGNING <ls_elem>.
    lv_count = lv_count + 1.
    IF checked = abap_true.
    context_element = wd_context->get_child_node( name = wd_this->wdctx_z9027 )->get_element( index = lv_count ).
    lo_componentcontroller = wd_this->get_componentcontroller_ctr( ).
    lo_componentcontroller->define_z9027_details( index = lv_count io_context_element = context_element ).
      <ls_elem>->set_attribute(
        EXPORTING
          name =  `POPIN_NAME`
          value = `TABLEPOPIN` ).
    ELSE.
      <ls_elem>->set_attribute(
        EXPORTING
          name =  `POPIN_NAME`
          value = `` ).
    ENDIF.
  ENDLOOP.