on 10-26-2009 9:09 AM
hi
i am creating an abap WD and i want that a certion button in the view i created will be disable or inVISIBLE?
how can i do that?
i have searched the forum and i only got information for java WD
thanks
Hi,
Bind the visibility property with the context attribute of the type WDUI_VISIBILITY.
Now in ur code based on the condition u can set the attribute value.
Set the value as '01' for visible and '02' for invisible.
DATA lo_el_context TYPE REF TO if_wd_context_element.
DATA ls_context TYPE wd_this->element_context.
DATA lv_ca_atttt LIKE ls_context-ca_atttt.
* get element via lead selection
lo_el_context = wd_context->get_element( ).
* get single attribute
lo_el_context->set_attribute(
EXPORTING
name = `CA_ATTTT`
value = '01' ).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi ,
u can disable /enable as well make visible /invisible ur UI elements
b) for making ur UI enable/disable , bind it with the context attribute of type wdy_boolean
using the set_attribute method
i) 'X'' to make the UI enable
ii) ' ' to make UI disable
Read context attribute using CODE WIZARD AND set it to 'X' using the method to make it enable
u can do it for idisable as well
// read attribute
DATA lo_nd_cn_visibility TYPE REF TO if_wd_context_node.
DATA lo_el_cn_visibility TYPE REF TO if_wd_context_element.
DATA ls_cn_visibility TYPE wd_this->element_cn_visibility.
DATA lv_ca_visible LIKE ls_cn_visibility-ca_visible.
* navigate from <CONTEXT> to <CN_VISIBILITY> via lead selection
lo_nd_cn_visibility = wd_context->get_child_node( name = wd_this->wdctx_cn_visibility ).
* @TODO handle not set lead selection
IF lo_nd_cn_visibility IS INITIAL.
ENDIF.
* get element via lead selection
lo_el_cn_visibility = lo_nd_cn_visibility->get_element( ).
// make UI enable
* set single attribute
lo_el_cn_visibility->set_attribute(
EXPORTING
name = `CA_VISIBLE`
IMPORTING
value = 'X').
regards,
amit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi ,
u can disable /enable as well make visible /invisible ur UI elements
a) for making ur UI visible /invisible , bind it with the context attribute of type wdui_visibility
using the set_attribute method
i) '01' to make the UI invisible
ii) '02' to make UI visible
Read context attribute using CODE WIZARD AND set it to '02' using the method to make it visible
u can do it for invisibility as well
// read attribute
DATA lo_nd_cn_visibility TYPE REF TO if_wd_context_node.
DATA lo_el_cn_visibility TYPE REF TO if_wd_context_element.
DATA ls_cn_visibility TYPE wd_this->element_cn_visibility.
DATA lv_ca_visible LIKE ls_cn_visibility-ca_visible.
* navigate from <CONTEXT> to <CN_VISIBILITY> via lead selection
lo_nd_cn_visibility = wd_context->get_child_node( name = wd_this->wdctx_cn_visibility ).
* @TODO handle not set lead selection
IF lo_nd_cn_visibility IS INITIAL.
ENDIF.
* get element via lead selection
lo_el_cn_visibility = lo_nd_cn_visibility->get_element( ).
// make UI visible
* set single attribute
lo_el_cn_visibility->set_attribute(
EXPORTING
name = `CA_VISIBLE`
IMPORTING
value = '02').
u can do it like this way as well :
wd_context->set_attribute( name = '<attribute name>' value = if_wdl_core=>visibility_visible )." to make it visible.
wd_context->set_attribute( name = '<attribute name>' value = if_wdl_core=>visibility_none ). "to make it invisible
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
There are two things : Visible/Invisible and Enable/Disable.
For making your button visible/invisible , Create a context Attribute of type wdui_visibility.
Set its Values : 01 , for making Invisible.
02 , for making Visible.
For making your button enable/disable, Create a context Attribute of type wdy_boolean.
Set its Values : 'X', for making Enable.
' ' , for making Diable.
I hope it helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
for ENABLED nature -
Create a context attribute ENABLED as wdy_boolean
Bind the enabled proeperty of that Inout field to this attribute
IF wd_comp_controller->gv_read_only EQ 'X'.
lv_enabled = abap_false. "Disable
else.
lv_enabled = abap_true. "Enable
ENDIF.
wd_context->set_attribute
exporting
value = lv_enabled
name = 'ENABLED'
Regards,
Lekha.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Create a attribute of type wdy_boolean and bind it with the enable property of Button..
To enable set it as 'X'
To Disable set it as ''.
Regards,
Rohit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
To make a button visible or invisible create an attribute in the context and bind it the VISIBLE property of the button
to make it enable or disabled bind to ENABLED property of the input field.
According to criteria make it abap_true or abap_false.
you enable or disable in the following way:
DATA lo_nd_user_view TYPE REF TO if_wd_context_node.
DATA lo_el_user_view TYPE REF TO if_wd_context_element.
DATA ls_user_view TYPE wd_this->element_user_view.
lo_nd_user_view = wd_context->get_child_node( name = wd_this->wdctx_user_view ).
lo_el_user_view = lo_nd_user_view->get_element( ).
lo_el_user_view->set_attribute(
EXPORTING
name = `SAVE_CANCEL_ENABLE`
value = abap_false ).
Regards,
Priya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.