Quantcast
Viewing all articles
Browse latest Browse all 1237

Dropdown inside a "dynamic" table

Hi all,

 

Hope you can help me on this

 

Scenario: Adobe Form in ABAP (not WebDynpro), we created a form and we are calling the Function Module (FM) associated to this form from an ABAP program. Two parameter, one to populate main table data, one for dropdown values.

 

The PDF form has a table embeded within a subform (drag and drop from hierarchy view to subform). The amount of records in the table will depend on the input table that is passed from the ABAP program.

 

To populate the dropdown we are using the following code written in the initialize command:

 

for(var i=0; i<DATA_TABLE.DATA.instanceManager.count ; i++) <--this is main table loop 
{                var item = Body.resolveNode("DATA_TABLE.DATA[" + i + "].DROPDOWN_TABLE");    item.clearItems();                    for(var j = 0; j<DROPDOWN_DATA.DATA.instanceManager.count; j++) <-- this is the loop for populating dropdown    {                var dropdownItem = Body.resolveNode("DROPDOWN_DATA.DATA[" + j + "].dropdown_table_field");                  item.addItem(dropdownItem.rawValue);    }  
}

 

The problem is that we are doing main table loop for each attribute. we have one column where the dropdown are displayed, the values are the same, we do the second loop for each one.

 

the form table is displayed as follows:

 

 

¦=============¦=============¦¦   Header1   ¦  Header 2   ¦¦=============¦==============¦ Textfield 1 ¦  Dropdown1  ¦¦-------------¦-------------¦¦ Textfield 2 ¦  Dropdown2  ¦¦-------------¦-------------¦¦ Textfield N ¦  DropdownN  ¦¦-------------¦-------------¦

 

All the dropdowns have the same values, but I cannot find a way to do it without looping the DROPDOWN_TABLE each time.

 

Is there any way to just instance one dropdown element and then assign or copy the values to the other dropdowns and skip the loop?

 

Is it possible to dismiss the outside loop by putting the dropdown (and all attributes) initialization inside the initialization of the table?

 

For your help, thanks in advance.

 

Best Regards,

Mauro.-

 


Viewing all articles
Browse latest Browse all 1237

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>