on 2014 Jun 21 7:07 AM
its very urgent
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kaustav,
As per your snapshot,
1) Create two radio button groups
Group-1 containing radio buttons
RGP
NGRP
Group-2 containing radio buttons
PO ( Where in you need to bind the visibility of this radio button to boolean attribute)
NON-PO ( Where in you need to bind the visibility of this radio button to boolean attribute)
2) Now on selecting RGP radio button,set the boolean attribute visibility to ABAP_TRUE. Then two radio buttons as per your requirement will be visible.
ie. IF RG_RDP = 'X'. " Radio button RGP is selected.
LO_EL_<NODENAME>->SET_ATTRIBUTE( NAME = ' BOOLEAN ATTRIBUTE NAME'
VALUE = ABAP_TRUE ).
ENDIF.
Hope this helps you.
Thanks
KH
Hi,
Browse through the below links which will helps you to understand better.
Displaying text and radio button using WebDynpro for ABAP
Thanks
KH
Hi Kaustav,
As per your snapshot,
1) Create two radio button groups
Group-1 containing radio buttons
RGP
NGRP
Group-2 containing radio buttons
PO ( Where in you need to bind the visibility of this radio button to boolean attribute)
NON-PO ( Where in you need to bind the visibility of this radio button to boolean attribute)
2) Now on selecting RGP radio button,set the boolean attribute visibility to ABAP_TRUE. Then two radio buttons as per your requirement will be visible.
ie. IF RG_RDP = 'X'. " Radio button RGP is selected.
LO_EL_<NODENAME>->SET_ATTRIBUTE( NAME = ' BOOLEAN ATTRIBUTE NAME'
VALUE = ABAP_TRUE ).
ENDIF.
Hope this helps you.
Thanks
KH
IN THE ABOVE CODE SHOWING SOME ERROR..HOW TO RESOLVE IT
DEAR EXPERTS,
method ONACTIONONREAD .
DATA lo_nd_radio_a TYPE REF TO if_wd_context_node.
DATA lo_el_radio_a TYPE REF TO if_wd_context_element.
DATA ls_radio_a TYPE wd_this->Element_radio_a.
* navigate from <CONTEXT> to <RADIO_A> via lead selection
lo_nd_radio_a = wd_context->get_child_node( name = wd_this->wdctx_radio_a ).
* @TODO handle non existant child
* IF lo_nd_radio_a IS INITIAL.
* ENDIF.
* get element via lead selection
lo_el_radio_a = lo_nd_radio_a->get_element( ).
* @TODO handle not set lead selection
** IF lo_el_radio_a IS INITIAL.
** ENDIF.
* get all declared attributes
lo_el_radio_a->get_static_attributes(
IMPORTING
static_attributes = ls_radio_a ).
DATA lo_nd_radio_b TYPE REF TO if_wd_context_node.
DATA lo_el_radio_b TYPE REF TO if_wd_context_element.
DATA ls_radio_b TYPE wd_this->Element_radio_b.
* navigate from <CONTEXT> to <RADIO_B> via lead selection
lo_nd_radio_b = wd_context->get_child_node( name = wd_this->wdctx_radio_b ).
* @TODO handle non existant child
* IF lo_nd_radio_b IS INITIAL.
* ENDIF.
* get element via lead selection
lo_el_radio_b = lo_nd_radio_b->get_element( ).
IF LS_RADIO_A-RADIO1 = ' X '. " Radio button RGP is selected.
LO_EL_RADIO_B->SET_ATTRIBUTE( NAME = ' radio3 ' VALUE = ABAP_TRUE ).
**elseif ls_radio_A-radio2 = ' x '.
**
** lo_el_radio_b->set_attribute( name = 'radio4' value = abap_false ).
ENDIF.
* @TODO handle not set lead selection
** IF lo_el_radio_b IS INITIAL.
** ENDIF.
* get all declared attributes
lo_el_radio_b->get_static_attributes(
IMPORTING
static_attributes = ls_radio_b ).
AFTER WRITTING THIS CODE if i not selecting anything it is showing that po and non po radio button..see below image
Hi Kastav,
In WDDOINIT( ) method of that view(in which you have radio buttons) set the visibility of PO,NON-PO radiobuttons to abap_false( i.e invisibile).
Purpose : Initially as you want to hide that radio buttons and based on your condition enable( set visibility as abap_true( visible) ) .
Thanks
KH
DEAR HAWKINS,
how can i solve it..pleasee help me to resolve this
select of first radio buttoon rgp method,
method ONACTIONON_SELECT .
DATA lo_nd_radio_a TYPE REF TO if_wd_context_node.
DATA lo_el_radio_a TYPE REF TO if_wd_context_element.
DATA ls_radio_a TYPE wd_this->Element_radio_a.
DATA lv_radio1 TYPE wd_this->Element_radio_a-radio1.
DATA lo_el_context TYPE REF TO if_wd_context_element.
DATA ls_context TYPE wd_this->Element_context.
DATA lv_visibility TYPE wd_this->Element_context-visibility.
* navigate from <CONTEXT> to <RADIO_A> via lead selection
lo_nd_radio_a = wd_context->get_child_node( name = wd_this->wdctx_radio_a ).
* @TODO handle non existant child
* IF lo_nd_radio_a IS INITIAL.
* ENDIF.
* get element via lead selection
lo_el_radio_a = lo_nd_radio_a->get_element( ).
* alternative access via index
* lo_el_radio_a = lo_nd_radio_a->get_element( index = 1 ).
* @TODO handle not set lead selection
** IF lo_el_radio_a IS INITIAL.
** ENDIF.
* get single attribute
lo_el_radio_a->get_attribute(
EXPORTING
name = `RADIO1`
IMPORTING
value = lv_radio1 ).
* get element via lead selection
lo_el_context = wd_context->get_element( ).
IF lv_radio1 = 'x'.
lv_visibility = 02.
else.
lv_visibility = 01.
ENDIF.
* @TODO handle not set lead selection
** IF lo_el_context IS INITIAL.
** ENDIF.
* @TODO fill attribute
* lv_visibility = 1.
* set single attribute
lo_el_context->set_attribute(
name = `VISIBILITY`
value = lv_visibility ).
endmethod.
select of second radio button nrgp
method ONACTIONON_SELECT1 .
DATA lo_nd_radio_a TYPE REF TO if_wd_context_node.
DATA lo_el_radio_a TYPE REF TO if_wd_context_element.
DATA ls_radio_a TYPE wd_this->Element_radio_a.
* navigate from <CONTEXT> to <RADIO_A> via lead selection
lo_nd_radio_a = wd_context->get_child_node( name = wd_this->wdctx_radio_a ).
* @TODO handle non existant child
* IF lo_nd_radio_a IS INITIAL.
* ENDIF.
* get element via lead selection
lo_el_radio_a = lo_nd_radio_a->get_element( ).
ls_radio_A-key_to_select = ' x '.
ls_radio_A-radio1 = ' '.
ls_radio_A-radio2 = ' x '.
* @TODO handle not set lead selection
** IF lo_el_radio_a IS INITIAL.
** ENDIF.
* @TODO fill static attributes
* ls_radio_a = xxx->get_yyy( ).
* set all declared attributes
lo_el_radio_a->set_static_attributes(
static_attributes = ls_radio_a ).
endmethod.
and THE WDDOINIT METHOD
method WDDOINIT .
DATA lo_nd_radio_a TYPE REF TO if_wd_context_node.
DATA lo_el_radio_a TYPE REF TO if_wd_context_element.
DATA ls_radio_a TYPE wd_this->Element_radio_a.
DATA lv_radio1 TYPE wd_this->Element_radio_a-radio1.
* navigate from <CONTEXT> to <RADIO_A> via lead selection
lo_nd_radio_a = wd_context->get_child_node( name = wd_this->wdctx_radio_a ).
* @TODO handle non existant child
* IF lo_nd_radio_a IS INITIAL.
* ENDIF.
* get element via lead selection
lo_el_radio_a = lo_nd_radio_a->get_element( ).
ls_radio_A-key_to_select = ' x '.
ls_radio_A-radio1 = ' x '.
ls_radio_A-radio2 = ' '.
* @TODO handle not set lead selection
** IF lo_el_radio_a IS INITIAL.
** ENDIF.
* @TODO fill static attributes
* ls_radio_a = xxx->get_yyy( ).
* set all declared attributes
lo_el_radio_a->set_static_attributes(
static_attributes = ls_radio_a ).
* navigate from <CONTEXT> to <RADIO_A> via lead selection
lo_nd_radio_a = wd_context->get_child_node( name = wd_this->wdctx_radio_a ).
* @TODO handle non existant child
* IF lo_nd_radio_a IS INITIAL.
* ENDIF.
* get element via lead selection
lo_el_radio_a = lo_nd_radio_a->get_element( ).
* alternative access via index
* lo_el_radio_a = lo_nd_radio_a->get_element( index = 1 ).
* @TODO handle not set lead selection
* IF lo_el_radio_a IS INITIAL.
* ENDIF.
* get single attribute
lo_el_radio_a->get_attribute(
EXPORTING
name = `RADIO1`
IMPORTING
value = lv_radio1 ).
endmethod...
Hi Kaustav,
You can achieve your requirement as below
Hope this helps you.
Regards,
Rama
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
77 | |
10 | |
10 | |
10 | |
10 | |
9 | |
8 | |
7 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.