Skip to Content
avatar image
Former Member

Place dynamic field at correct position

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Feb 16, 2011 at 11:31 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 17, 2011 at 07:58 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 17, 2011 at 08:11 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded