cancel
Showing results for 
Search instead for 
Did you mean: 

Place dynamic field at correct position

Former Member
0 Kudos

Hi all,

I have a group in which i have created a dropdown

As per my requirement on click of a button i need to generate the same dropdown, i/p field again

I have achieved this but the dynamically created ui elements doesnt comes at the right position

ie just under the first group

Can some one please suggest me with this

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Bhanu,

It is depends on the layout you have chosen and on which UI container you add the new element.

For example Flowlayout would add the elements in sequence from left to right.

In your case you might have added the new element to the rootcontainer and that might be the reason that it is coming under the group.

As already suggested in this forum, choose right Layout and right container.

gill367
Active Contributor
0 Kudos

Use the matrix layout or row layout in the container where you are adding the elements

and when adding a new row

set the layout data to the matrix head data for the first element and then add it.

for rest of them keep it matrix data only.

then they will come in a symmetric view.

thanks

sarbjeet singh

Former Member
0 Kudos

Hello,

You can use the following code in the wddomodifyview() method to add elements inside the Group:

data grp type REF TO cl_wd_group.

data LR_FLOW_DATA type ref to CL_WD_FLOW_DATA.

data button type ref to CL_WD_BUTTON.

button = CL_WD_BUTTON=>NEW_BUTTON( ).

LR_FLOW_DATA = CL_WD_FLOW_DATA=>NEW_FLOW_DATA( element = button ).

button->set_text( value = 'Check').

grp ?= view->GET_ELEMENT( 'GRP' ).* where GRP is the id of the Group created at designtime.

grp->add_child( button ).

Thanks.