on 08-21-2009 12:41 PM
Hi,
I my view, i have a radiobutton and its 'keyToSelect' property should be binded dynamically based on my requirement. I have corresponding node with multiple attributes.
Please point me to some sample code on how to achieve this.
Thanks & Regards,
Gaurav.
Answered
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
For ex:
Create 3 context attributes as string
DW,CN, GROUP and give defalut values as DW for DW attribute and CN for CN attribute.These are directly under root node.
Now bind Key to Select property of the 1 radiobuttons to DW and CN respectively.
And for these 2 buttons, KEYTOSELECT is bound to GROUP.
in the WDDDOINT-
* Set single attribute
lv_group = 'CN'.
CALL METHOD wd_context->set_attribute
EXPORTING
value = lv_group
name = wd_assist->gc_group. "`GROUP`
Implement the event onSelect for 2 radiobuttons -
DATA:
lv_group LIKE ls_context-group.
*Move the type of display to the context attribute
lv_group = wdevent->get_string( wd_assist->GC_key ). "'KEY'.
* get element via lead selection
wd_comp_controller->gref_element = wd_context->get_element( ).
if wd_comp_controller->gref_element is not initial.
* Set single attribute
CALL METHOD wd_comp_controller->gref_element->SET_ATTRIBUTE
EXPORTING
VALUE = lv_group
NAME = wd_assist->gc_group. "`GROUP`
endif. "IF wd_comp_controller->gref_element is not initial.
Regards,
Lekha.
Hi,
Are the radio buttons are inside the table UI element.
And if the context attributes are inside the node to which the TAble is bound then you need to update the internal table as well
then bind the internal table to node.
For Ex: I have the following node bound to the Table UI element have attributes like
VBELN(Text view), ERDAT(Text View), RB1(Radiobutton),RB2(Radiobutton),GROUP(Hidden field). RB1, RB2,GROUP have string types.
To the KEYTOSELECT property of the radiobuttons, bind to the GROUP.
Bind SelectedKey to RB1 for 1st radiobutton, bind selectedkey to RB2 of 2nd radiobutton.
DATA lo_nd_vbak TYPE REF TO if_wd_context_node.
DATA lt_vbak TYPE wd_this->elements_vbak.
DATA ls_vbak TYPE wd_this->element_vbak.
* navigate from <CONTEXT> to <VBAK> via lead selection
lo_nd_vbak = wd_context->get_child_node( name = wd_this->wdctx_vbak ).
SELECT * FROM vbak INTO CORRESPONDING FIELDS OF TABLE lt_vbak
WHERE vbeln = lv_vbeln.
loop at lt_vbak into ls_vbak.
ls_vbak-group = 'X'. "KeyToSelect
ls_vbak-rb1 = 'X'. "By default first radiobutton is selected for all rows
modify lt_vbak from ls_vbak index sy-tabix.
endloop.
* @TODO handle non existant child
IF lo_nd_vbak IS NOT INITIAL.
lo_nd_vbak->bind_table( lt_vbak ).
ENDIF.
Regards,
Lekha.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.