cancel
Showing results for 
Search instead for 
Did you mean: 

ItemListBox - please help

former_member678355
Participant
0 Kudos

Hi,

I am very new to WDA, and am having difficulty populating an ItemListBox at runtime. I have bound the table to a node (COUNTRY, 0..n), and the text property to an element of that node (ZCOUNTRY_TEXT), and nothing appears on screen.

I have searched this forum, and I think I need to add code to populate it. I have looked at these 3 threads:

However, it still doesn't solve my issue. Do I need to add code? Or do I have the properties setup wrong?

I would very much appreciate help, and as always, will reward points.

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member678355
Participant
0 Kudos

On the INIT method of the view, small code needs to be added:

*Define local node and local table

data: node_country TYPE REF TO IF_WD_CONTEXT_NODE,

lt_texts type TABLE OF zcountries.

*Assign local node to context node

NODE_country = WD_CONTEXT->GET_CHILD_NODE( NAME = `COUNTRY` ).

*Put entries into local table

SELECT ZCOUNTRY_TEXT into CORRESPONDING FIELDS OF TABLE lt_texts

from zcountries.

*Bind the local table to the context

node_country->BIND_TABLE( EXPORTING NEW_ITEMS = lt_texts SET_INITIAL_ELEMENTS = ABAP_TRUE ).

former_member678355
Participant
0 Kudos

Yes, I have a text element (which contains the country name), and a value element. Both of these are under my node.

Former Member
0 Kudos

stupid question:

did you supply the node with elements?

Cheers,

Sascha