cancel
Showing results for 
Search instead for 
Did you mean: 

using buttons

Former Member
0 Kudos

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.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

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.

Former Member
0 Kudos

IF lv_flag eq 'X'.

bt->set_visible( 02 ). " Visable

ELSE

bt->set_visible( 01 ). " not Visable

ENDIF.

Former Member
0 Kudos

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

abhimanyu_lagishetti7
Active Contributor
0 Kudos

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

Former Member
0 Kudos

hi,

i m talking about database table. i can not change it.

i have to check the field value of database table and based on that value button should be visible.

abhimanyu_lagishetti7
Active Contributor
0 Kudos

Hi Pankaj

don't change the database table just add context attribute to the node

Abhi