cancel
Showing results for 
Search instead for 
Did you mean: 

Dropdown inside a "dynamic" table

Former Member
0 Kudos

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.-

Accepted Solutions (1)

Accepted Solutions (1)

OttoGold
Active Contributor
0 Kudos

Hello,

Does that mean that the ordinary binding does not work for you? Like when you have one line repeated for each data item, the values are not "filled in" automatically? When you apply something on a row, it should work for every row...

By the way do you know you can place the script (event: initialization, yes, for example) on the line level (subform line) and work with "this" pointer and the script will be clled for every row created by the instance manager?

Did you try to use the dynamic binding? For example...

Regards Otto

Former Member
0 Kudos

Thanks Otto,

This form is used to update or modify the data in the DATA_TABLE. In design time I have the dropdown. the problem is that the initial value that must be shown in the dropdown comes from the DATA_TABLE but the possible values come from the DROPDOWN_TABLE. This table only has one field with the data to show in the dropdown, so the binding for this dropdown is the field in the main table not the dropdown table. So, the value that is already in the DATA_TABLE (main table) is shown correctly beacause of the binding, but we also have to add to the dropdown all the possible values.

In your second observation, you talked about to put the script in the line initialization. this should be done in a script object outside the table, subform, main page or it should be done in the table initialize method?

the use of Dinamic binding, i have never done it before, i will look for information about it and see it that helps.

Can you please explain to me the second option?

In advance, thanks a lot.

OttoGold
Active Contributor
0 Kudos

Hello again,

1) i understand your binding problem. I am not sure exactly how that works, but maybe you can use the binding to fill the dropdown for you and then use scripting to set the selectedIndex = 5 for example, wouldn´t that help? Maybe not, I am ho real experience with DDs, just a guess. And when sending the data back from the form capture only the selected index?

Maybe this can help?:

2) initialize event, table line subform level (that thing that is bound to DATA[*])

http://www.adobe.com/devnet/livecycle/articles/lc_designer_scripting_basics/lc_designer_scripting_ba...

3) you should be able to find that easily, I have answered some questions about that here.

Like this one:

Hope that helps, Otto

Former Member
0 Kudos

Hi Otto,

Thanks once again for your help. I solved the problem by filling the dropdown in the table line initialize action. The performance is better doing it this way than filling each dropdown in the corresponding initialization.

Thanks again.

OttoGold
Active Contributor
0 Kudos

Glad to help, glad it works:))

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi There,

I am facing a problem regarding Dropdown lists in Subform.

I want the top dropdown list values on all bottom left dropdown lists when I press the button.

The bottom left dropdown lists are in the subforms. So When I use java script like this :

data.Daten.Daten.Daten.Data.DropDown.rawValue =  data.Daten.Aktion.DropDown.rawValue;

It does only change first dropdownlist value, not others.

Please provide solution that How can I change all dropdown lists of a Subform dynamically?

Waiting for reply.

OttoGold
Active Contributor
0 Kudos

Do not care about the points, yes, it is nice to be "awarded", but I didn´t help you for the "money", ok?:)) It was a pleasure to meet you and I am looking forward to see you around as a valuable community member helping others (for points:))) or at least as a passionate Adobe forms developer. That applies to all the great people around here. Have a nice, sun-shining day, regards Otto

Former Member
0 Kudos

did you received the points right?

if not, let me know how it has to be done. I just click next to your answer and gave you 6 for the first reply and 10 for the second and final one.

once again, thanks a lot for all your help.

Former Member
0 Kudos

HI,

I know I recently joined this community, but any help will be really appreciate... please if someone know anything that might help, it would be great.