on 08-17-2011 6:15 AM
Hi Experts,
I am working with dynamic programming... to create the 4 input fileds in one row.
I have a add button once I click on the add button on the view its creating a row with 4 input fileds.
But problem is if press 2 times the new row is creating on top .. But my req is that it should create the new row in the bottom.
Below methods I am using.
CALL METHOD cl_wd_input_field=>new_input_field
CALL METHOD lr_container->add_child
Please let me know how can i achive this...
Thanks in advance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Anil,
Normally if you add a new child to the container it will automatically add it as last element. I'm wondering why its not case with your application. Its really strange.
What you can do it
1. Get the number of children in the container (check in CL_WD_TRANSPARENT_Container) there will be a method to get the number of children
2. while adding a new child, set the index as well( here index should be number of children in the container + 1)
Alternatively, you can post your dynamic UI element creation code (complete code) we can check and point out the error if any.
BR, Saravanan
Hi Saraa_n
Thanks for your reply.....
below is the code I am using. Please check and suggest me if any
lr_container ?= view->get_element( 'TC_HEALTH_TEXT' ).
lr_container->SET_VISIBLE( '02' ).
gv_id = ls_add-add_att.
Delete Button
gv_id = gv_id + 1.
CONCATENATE 'CHAR' gv_id INTO gv_char.
lr_button = cl_wd_button=>new_button( ).
lr_button->SET_VISIBLE( '02' ).
For Grid
lr_grid = cl_wd_grid_data=>new_grid_data( lr_button ).
CALL METHOD lr_grid->set_padding_left
EXPORTING
value = '01'.
value = '182'.
CALL METHOD lr_container->add_child
EXPORTING
index = 1
the_child = lr_button.
lr_button->set_text( 'Delete').
lr_button->set_width( '65' ).
lr_button->set_on_action( 'DELETE_H').
lr_button->set_tooltip( 'Delete Current Department Objective').
Complete By Field
gv_id = gv_id + 1.
CONCATENATE 'CHAR' gv_id INTO gv_char.
if wd_comp_controller->GV_NUM = '00'.
wd_comp_controller->GV_NUM = '01'.
endif.
CONCATENATE 'ZHGOALS' wd_comp_controller->GV_NUM '.ZCOMPLETE' into gv_complete.
CONCATENATE 'ZHGOALS' wd_comp_controller->GV_NUM '.ZDESC' into gv_desc.
CONCATENATE 'ZHGOALS' wd_comp_controller->GV_NUM '.ZBSC_CODE' into gv_bsc_code.
wd_comp_controller->GV_NUM = wd_comp_controller->GV_NUM + 1.
CALL METHOD lr_grid->set_padding_left
EXPORTING
value = '95'.
CALL METHOD cl_wd_input_field=>new_input_field
EXPORTING
bind_value = gv_complete
id = gv_char "'CHAR3'
width = '68'
RECEIVING
control = lr_input.
gv_id = gv_id + 1.
CONCATENATE 'CHAR' gv_id INTO gv_char.
For Grid
lr_grid = cl_wd_grid_data=>new_grid_data( lr_input ).
lr_input->set_layout_data( lr_grid ).
CALL METHOD lr_container->add_child
EXPORTING
index = 1
the_child = lr_input.
To Create Description field
CALL METHOD lr_grid->set_padding_left
EXPORTING
value = '30'.
CALL METHOD cl_wd_input_field=>new_input_field
EXPORTING
bind_value = gv_desc
id = gv_char "'CHAR2'
width = '700'
RECEIVING
control = lr_input.
For Grid
lr_grid = cl_wd_grid_data=>new_grid_data( lr_input ).
lr_input->set_layout_data( lr_grid ).
CALL METHOD lr_container->add_child
EXPORTING
index = 1
the_child = lr_input.
To Ceate BSC Code
CALL METHOD lr_grid->set_padding_left
EXPORTING
value = '70'.
gv_id = gv_id + 1.
CONCATENATE 'CHAR' gv_id INTO gv_char.
CALL METHOD cl_wd_input_field=>new_input_field
EXPORTING
bind_value = gv_bsc_code
id = gv_char "'CHAR1'
width = '25'
READ_ONLY = 'X'
RECEIVING
control = lr_input.
For Grid
lr_grid = cl_wd_grid_data=>new_grid_data( lr_input ).
lr_input->set_layout_data( lr_grid ).
CALL METHOD lr_container->add_child
EXPORTING
index = 1
the_child = lr_input.
Hi Saraa_n
Thanks for your reply.....
below is the code I am using. Please check and suggest me if any
lr_container ?= view->get_element( 'TC_HEALTH_TEXT' ).
lr_container->SET_VISIBLE( '02' ).
gv_id = ls_add-add_att.
Delete Button
gv_id = gv_id + 1.
CONCATENATE 'CHAR' gv_id INTO gv_char.
lr_button = cl_wd_button=>new_button( ).
lr_button->SET_VISIBLE( '02' ).
For Grid
lr_grid = cl_wd_grid_data=>new_grid_data( lr_button ).
CALL METHOD lr_grid->set_padding_left
EXPORTING
value = '01'.
value = '182'.
CALL METHOD lr_container->add_child
EXPORTING
index = 1
the_child = lr_button.
lr_button->set_text( 'Delete').
lr_button->set_width( '65' ).
lr_button->set_on_action( 'DELETE_H').
lr_button->set_tooltip( 'Delete Current Department Objective').
Complete By Field
gv_id = gv_id + 1.
CONCATENATE 'CHAR' gv_id INTO gv_char.
if wd_comp_controller->GV_NUM = '00'.
wd_comp_controller->GV_NUM = '01'.
endif.
CONCATENATE 'ZHGOALS' wd_comp_controller->GV_NUM '.ZCOMPLETE' into gv_complete.
CONCATENATE 'ZHGOALS' wd_comp_controller->GV_NUM '.ZDESC' into gv_desc.
CONCATENATE 'ZHGOALS' wd_comp_controller->GV_NUM '.ZBSC_CODE' into gv_bsc_code.
wd_comp_controller->GV_NUM = wd_comp_controller->GV_NUM + 1.
CALL METHOD lr_grid->set_padding_left
EXPORTING
value = '95'.
CALL METHOD cl_wd_input_field=>new_input_field
EXPORTING
bind_value = gv_complete
id = gv_char "'CHAR3'
width = '68'
RECEIVING
control = lr_input.
gv_id = gv_id + 1.
CONCATENATE 'CHAR' gv_id INTO gv_char.
For Grid
lr_grid = cl_wd_grid_data=>new_grid_data( lr_input ).
lr_input->set_layout_data( lr_grid ).
CALL METHOD lr_container->add_child
EXPORTING
index = 1
the_child = lr_input.
To Create Description field
CALL METHOD lr_grid->set_padding_left
EXPORTING
value = '30'.
CALL METHOD cl_wd_input_field=>new_input_field
EXPORTING
bind_value = gv_desc
id = gv_char "'CHAR2'
width = '700'
RECEIVING
control = lr_input.
For Grid
lr_grid = cl_wd_grid_data=>new_grid_data( lr_input ).
lr_input->set_layout_data( lr_grid ).
CALL METHOD lr_container->add_child
EXPORTING
index = 1
the_child = lr_input.
To Ceate BSC Code
CALL METHOD lr_grid->set_padding_left
EXPORTING
value = '70'.
gv_id = gv_id + 1.
CONCATENATE 'CHAR' gv_id INTO gv_char.
CALL METHOD cl_wd_input_field=>new_input_field
EXPORTING
bind_value = gv_bsc_code
id = gv_char "'CHAR1'
width = '25'
READ_ONLY = 'X'
RECEIVING
control = lr_input.
For Grid
lr_grid = cl_wd_grid_data=>new_grid_data( lr_input ).
lr_input->set_layout_data( lr_grid ).
CALL METHOD lr_container->add_child
EXPORTING
index = 1
the_child = lr_input.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.