cancel
Showing results for 
Search instead for 
Did you mean: 

Display some constant in the input field and allow the user to change it.

Former Member
0 Kudos

Dear All,

I have a requirement in WDA to display inputfield with some constant initially and allow

the user to change that value according to his wish.Currently I am using UI Element

InputField for this,but I am not able to show the constant initially.

How can I achieve this pls suggest.

Thanks,

Reddy.

Accepted Solutions (0)

Answers (2)

Answers (2)

gill367
Active Contributor
0 Kudos

Input Field must be bound to a context attribute.

you can set the value of this context attribute in the init method and the value that you pass there will come in the input field

initally.

you can write the code suggested in the above post

or you can put some default value in the properties of the context attribute.

go to the context tab. select you attribute and in the properties you will have one property called default value.

fill your constant value there.

thanks

sarbjeet singh

Former Member
0 Kudos

Hi sudhir,

To display with default values, you need to write your code in wddointi method.

Check this code..

* navigate from <CONTEXT> to <INPUT> via lead selection
  lo_nd_input = wd_context->get_child_node( name = wd_this->wdctx_input ).

* get element via lead selection
  lo_el_input = lo_nd_input->get_element( ).

  lv_ship_point = '1001'.
* set single attribute
  lo_el_input->set_attribute(
    name  =  `SHIP_POINT`
    value = lv_ship_point ).  // Now ship_point have initial value 1001.

Cheers,

Kris.

Former Member
0 Kudos

Thanks problem solved!