Skip to Content
avatar image
Former Member

user hits the enter key

Hello Dear WD Experts,

I am facing a new problem.

There is a editable Table UI-Element on the view.

After any user has entered some data into the cells

he hits the enter key and I am intending to display

the result of mathematical calculation on a label.

Qestion 1)

How can I ask for a enter-key event

Qestion 2)

How can I refer to the label UI-Element in order

to display the result

I thank you all in advance for kindly efforts

Best Regards

Ilhan Ertas

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

4 Answers

  • Best Answer
    avatar image
    Former Member
    Apr 30, 2009 at 08:48 AM
    How can I ask for a enter-key event

    OnEnter event is available for cell editor 'Inputfield',

    goto table uielement->column->celleditor->events->OnEnter : Create an action.

    How can I refer to the label UI-Element in order to display the result

    Read your attribute which is bound to the label uielement and set the value

    " If you are directly bindind  an attribute, use this code
    
    DATA lo_el_context TYPE REF TO if_wd_context_element.
    
    * get element via lead selection
      lo_el_context = wd_context->get_element(  ).
    
    * get single attribute
      lo_el_context->set_attribute(
        EXPORTING
          name =  `CONTENT` " attribute name
        IMPORTING
          value = lv_value  ). " your result
    
    " If you are binding an attribute which is in a node, use this code
    
    Data: l_node type ref to if_wd_context_node.
    
    l_node = wd_context->get_child_node( 'NODE NAME' ).
    l_node->set_attribute( exporting name = 'attribute name'
                                                   value = lv_result ).

    Regards,

    Radhika.

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 30, 2009 at 08:55 AM

    Hi,

    I think You should use TextView in place of Label.

    Because Label will ask to set property Label For which is mandatory.

    I hope it helps.

    Regards,

    Rohit

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 30, 2009 at 08:38 AM

    Hi,

    As you said your table is editable.So the cell editor is input field.Go to properties of cell editor you will find event OnEnter create an event.This will trigger when you press Enter button.

    Is your lable part of of the table or outside of the table?

    If it is outside of the table create sepeate context attribute and bind the attribute to lable.When you calculate the amount just update the value to the context attribute.

    if it is another column.You already known which row it is and also you will have element reference.So you can easily update the value

    Edited by: suman kumar chinnam on Apr 30, 2009 10:38 AM

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 30, 2009 at 08:42 AM

    Hi,

    Create an action for sum logic and assign that action to onenter of inputfield . And Set the total in an attribute and bind it with label.

    I hope it helps.

    Regards,

    Rohit

    Add comment
    10|10000 characters needed characters exceeded