cancel
Showing results for 
Search instead for 
Did you mean: 

Reg Table edit by default

Former Member
0 Kudos

Hi Everyone,

i have one view with table which has three fields, when i click create button i want table fields to be in editable mode.

Regards,

vino.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi ,

create a Action for your Button UI , in the OnAction property . Create a context attribute under the context node

of type WDY_BOOLEAN .

Now bind it with the ENABLE property of your field which u want to set in enable mode . Set it to 'X' to enable the fields ,

and ' ' ( blank) to disable the field . Go to control wizard (CNTRL+F7) , selct read context node /attribute , select the appropriate

context attribute using set_attribute method


DATA lo_nd_cn_node TYPE REF TO if_wd_context_node.
    DATA lo_el_cn_node TYPE REF TO if_wd_context_element.
    DATA ls_cn_node TYPE wd_this->element_cn_node .
    DATA lv_attr  LIKE ls_city-ca_attr.
*   navigate from <CONTEXT> to <CN_VISIBLE> via lead selection
    lo_nd_node = wd_context->get_child_node( name = wd_this->wdctx_ca_attr).
 
*   get element via lead selection
    lo_el_cn_node = lo_nd_cn_node->get_element(  ).
 
*   set single attribute
    lo_el_cn_node->set_attribute(
      EXPORTING
        name =  `CA_ATTR`
    
        value = 'X').
// attribute CA_ATTR under node CN_NODE set to 'X'

regards,

amit

Former Member
0 Kudos

Thanks for your reply..

am using Table UI Element and i want first column to be enabled when i click on create button.

Regards,

vinoth

Former Member
0 Kudos

initially set the table column as disable , nw bind the table column ENABLE property with WDY_BOOLEAN

Former Member
0 Kudos

hi,

bind the First Column of Table with Wdy_boolean.

Set its value as ' ' by default and on the click of Create button , set it X to make it enable.

Answers (2)

Answers (2)

Former Member
0 Kudos

hi ,

u can bind the context attribute to the ENABLE property of ur TABLE UI as well , the table wud be editable

for enable /disable of ur UI , bind it with the context attribute of type WDY_BOOLEAN

set the context attribute to 'X' for enable and ' ' for disable

for visible/invisible of ur UI , bind VISIBLE property of it with the context attribute of type WDUI_VISIBILITY

set the context attribute to '02' for visible and '01 ' for invisible

regards,

amit

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Gnerally you would create a context attribute that you can use to control the read-only/edit mode of hte UI elements. When you press the button swap the value in this context attribute. Bind this attribut to the UI element properites for enabled.