cancel
Showing results for 
Search instead for 
Did you mean: 

initialization lead selection is blank

0 Kudos

I have a webdynpro with a table (read only) on the first screen.

When the user select a row in the table more fields will be displayed

in fields under the screen.

My problem is that when the screen appear the row is already selected.

The user have to click on the row again to display the extra fields.

I find a lot of info when google, but It still does not work.

I un-check the initialization lead selection field. This help that the first

row is not selected at first. If the employee select the row an error appear

that the lead selection index is 0.

Selection mode = auto.

Selection change behaviour = auto.

This is the code.

*lr_element = wdevent->get_context_element( name = 'CONTEXT_ELEMENT' ).

lo_node = wd_context->get_child_node( name = wd_this->wdctx_worklist ).

lr_element = lo_node->get_element( ).

  • lr_element = wdevent->get_context_element( name = 'CONTEXT_ELEMENT' ).

**lv_index = lr_element->get_index( ).

  • lo_node->set_lead_selection_index( index = lv_index ).

Thanks

Frances

Accepted Solutions (0)

Answers (2)

Answers (2)

ChrisPaine
Active Contributor
0 Kudos

the sub node you have referenced also doesn't have a lead selection defined as automatic - You can't just get the lead selection...

perhaps something like this would be better...

data: l_rows type i.

l_rows = lo_node->get_element_count( ).

if l_rows > 0.

lr_element = lo_node->get_element( 1 ).

else.

* issue no sub elements

endif.

Sharathmg
Active Contributor
0 Kudos

Dear Frances,

Kindly check the cardinality of the node "wdctx_worklist". If it is 0..1 or 0..n then an element is not created and you would have to create an element and then refer to it.

To resolve, check cardinality to 1..1 or 1..n.

Regards,

Sharath

Former Member
0 Kudos

Hi,

We faced a same issue. You can do a work around here.

When the table displays u can allow the first row to be selected in lead select.

Then in your leadselect code where that extra fields are displayed do the following.

1. Get you selected row in leadselect.

2. Now when your table opens this will not have any row. So if no row is selected default ur first row values for the extra fields

So ur first row fields ll be displayed even though lead select is not done