cancel
Showing results for 
Search instead for 
Did you mean: 

Bind the list of values into input field on screen

former_member223446
Active Participant
0 Kudos

Hi,

I have two input fields on my view layout(screen).

example field1,field2.

field1 contains list of values(f4) like A and B.

if I select 'A' in field1.. then in field2 .. automatically  1,

                                                                              2

                                                                              3 values should come

if I select 'B' in field1.. then in field2 .. automatically  4,

                                                                              5

                                                                              6 values should come.

I have created 'onselect' action for field1.so when i select value A or B..This method is triggered.but how to bind the list of values into field2,when i select 'A' or 'B' field1.

Accepted Solutions (1)

Accepted Solutions (1)

former_member198833
Active Participant
0 Kudos

Hi Kiran,

You could just bind a different Context Node for field2. Then, on action handler 'onSelect' for field1, filter or delete the unwanted values and re-bind the internal table for the Node of field.

Regards,

Felipe

former_member223446
Active Participant
0 Kudos

how can we bind the internal table to node of field2.I mean for paritcular field,how can we bind the internal table.

former_member198833
Active Participant
0 Kudos

Hi Kiran,

You bind the value property of the field to a Context Node and the internal table to that Context Node.

Let's suppose you have Node1 for field1 and Node2 for field2.


DATA lt_field1           TYPE wd_this->ELEMENTS_Node1.

DATA lt_field2           TYPE wd_this->ELEMENTS_Node2.


DATA lo_nd_field1     TYPE REF TO if_wd_context_node.

DATA lo_nd_field2     TYPE REF TO if_wd_context_node.

  

* navigate from context to nodes

   lo_nd_field1 = WD_CONTEXT->get_child_node( name = wd_this->WDCTX_Node1 ).

   lo_nd_field2 = WD_CONTEXT->get_child_node( name = wd_this->WDCTX_Node2 ).

** handle field1 and field2 filter logic for internal tables lt_field1  and lt_field2

* bind contents to field2

   lo_nd_field2->bind_table( new_items = lt_field2 ).

Regards,

Felipe

former_member223446
Active Participant
0 Kudos

Hi Felipe,

that code want you sent ,I wrote already.My issue is resolved with below code.

lr_node_info->set_attribute_value_set( name       = 'ATTR1'

                                                       value_set  = it_valueset ).

Answers (1)

Answers (1)

RicardoRomero_1
Active Contributor
0 Kudos

Hi,

I think you can use dropdowns for your requirement using the event onSelect.

check this example; it's with a table but you can do it with separate dropdowns.

Regards