on 05-14-2008 9:59 AM
Hello All,
Any one Please let me know how to create check boxes and toggle link dynamically based on table records. if i have 5 records in a table, i need to create 5 checkboxes and 5 toggle link .
Thanks in advance,
Sachin
hi,
Data: lr_ui_root type ref to if_wd_view_element,
Lr_container type ref to cl_wd_uielement_container.
*get reference to any node
Lr_ui_root = view->get_element(
Exporting
Id = ROOT UIELEMENTCONTAINER).
Lr_container ?= lr_ui_root.
*set container properties
Call method cl_wd_matrix_layout=>new_matrix_layout
Exporting
Container = lr_container.
*set width
Call method lr_container-.set_width
Exporting
Value = 100%.
Data :lr_check_box type ref to cl_wd_checkbox.
lv_cb_id type string,
lv_bind_checked type string,
lr_cb_new type ref to cl_wd_checkbox,.
Lr_check_box =cl_wd_checkbox=>new_checkbox(
exporting
id = lv_cb_id
bind_checked = lv_bind_checked
read_only = 'X'
receiving
control = lr_cb_new ).
Lr_container->add_child(exporting the_child = lr_check_box).
similarly create a toggle link using class CL_WD_TOGGLE_LINK for toggle link
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sachin
just try the following code.
DATA: lr_ui_root TYPE REF TO if_wd_view_element.
DATA: lr_check TYPE REF TO cl_wd_checkbox.
DATA: lr_container TYPE REF TO cl_wd_uielement_container,
lo_layout_data TYPE REF TO cl_wd_flow_data.
DATA: lv_id TYPE string.
*Declare a parameter io_view ref to if_wd_view.
CALL METHOD io_view->get_element
EXPORTING
id = 'TC_ATTR_SRCH_CRITERIA'
RECEIVING
element = lr_ui_root.
lr_container ?= lr_ui_root.
*TC_ATTR_SRCH_CRITERIA is the tranparent container which *i have created statically.
lr_container ?= lr_ui_root.
CALL METHOD cl_wd_flow_layout=>new_flow_layout
EXPORTING
container = lr_container.
CALL METHOD cl_wd_checkbox=>new_checkbox
EXPORTING
id = lv_id
bind_checked = 'PROCESSES.CHECK'----
> create a node(process) and attribute (check->WDY_BOOLEAN) in context
enabled = 'X'
*read_only = 'X'
visible = '02'
*view = VIEW
RECEIVING
control = lr_check.
cl_wd_flow_data=>new_flow_data(
EXPORTING
element = lr_check
).
lr_container->add_child(
EXPORTING
the_child = lr_check ).
similarly u can use the class CL_WD_TOGGLE_LINK to create toggle link.
regards
chythanya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi sachin.......
use themethod new_checkbox in the class cl_wd_checkbox to create a new check box. first read the number of records and loop it accordingly.
---regards,
alex b justin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
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.