on 08-20-2008 9:32 AM
hi,
i have to check the value of a field of a table and if that value is 'x' then buttons should not be visible when i run the application. for all other values of table field it should be visible. plz give the some dummy program also.
Hi Pankaj,
You can change the button visibility dynamically or run time. I am putting some model code to change the visibility at runtime. You have to code it in WDDOMODIFYVIEW method of the particulate view.
method WDDOMODIFYVIEW .
DATA lo_nd_fg TYPE REF TO if_wd_context_node.
DATA lo_el_fg TYPE REF TO if_wd_context_element.
DATA ls_fg TYPE wd_this->element_fg.
navigate from <CONTEXT> to <FG> via lead selection
lo_nd_fg = wd_context->get_child_node( name = wd_this->wdctx_fg ).
get element via lead selection
lo_el_fg = lo_nd_fg->get_element( ).
@TODO handle not set lead selection
IF lo_el_fg IS INITIAL.
ENDIF.
bt ?= view->get_element( 'BUTTON' ).
IF lv_flag eq 'X'.
bt->set_visible( 02 ).
ELSE
bt->set_visible( 02 ).
ENDIF.
endmethod.
Please let me know if you have any issue.
Regards
Satrajit.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If the button is there in the table , then add one more field called Visibility in that table strucuture , then
In WDDOINT/WDDOMODIFY method,
get the static attribute of of that field
write logic ,
if field_value = 'X'.
visibility = ' '.
elseif field_value = ' '.
visibility = ' X'.
endif.
Bind the visibility of that button UI to this above visibility field .
Girish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
add another Context Attribute say 'VISIBLE' of type WDY_VISIBILITY to the Context Node binded to your Table control as dataSource
bind it with the button visible property.
now while filling values in the context node based on the value X for what ever column set the newly attribute's value as if_wdl_core=>visibility_visible or if_wdl_core=>visibility_none
Abhi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.