cancel
Showing results for 
Search instead for 
Did you mean: 

OVS search help: how to trigger a refresh of the main view?

matteo_montalto
Contributor
0 Kudos

Hi all gurus,

please forgive if this argument has been already discussed, I searched and found similar issues but nothing seems to fit exactly to my situation, even though I guess it's quite a common desiderata.

Shortly; in a view, I have a search help associated to a field. Once the search help is triggered and the selection is done, the user must press explicitly the ENTER button after the selection has done. Only after the enter press the view is refreshed ( = trigger of WDDOMODIFYVIEW with the new value associated to the input field).

That's not intuitive for the user, which would like to see an automatic refresh after the selection is done.

As far as I've read, it seems that this behaviour cannot be obtained with "simple" search help, but only for freely programmed or OVS search help.

I guess this could be obtained firing an event in the phase3 of the OVS method, but I don't know how to do that and what's event to raise in order to emulate a selection + enter press. Could anyone help me ? If I miss some discussion on the argument, links are welcome.

Thanks again.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Yes, Using OVS or Freely programmed. In OVS, after the selection is done and user clicks on OK button then the PHASE3 event of the OVS is called. If you want to set some value then you can directly read that attribute of the node and set the value. No, need to raise any event like ENTER here..as OOK calls the PHASE3 event..You can write the code here..

Regards,

Lekha.

matteo_montalto
Contributor
0 Kudos

Hi Lekha,

in phase 3 I have something like this:

IF <ls_selection> IS ASSIGNED.
          ovs_callback_object->context_element->set_attribute(
                                 name  = `myInputField`
                                 value = <ls_selection>-input_field_alias_in_selection ).

and this works, in the sense that the chosen value DO populate the inputfield. But this doesn't imply an ENTER press; in fact, after the selection has been done, the field is filled with the chosen value but no refresh is then triggered. To trigger the refresh, I should place the cursor in the input field, click on it and press "ENTER". Then, the view is refreshed w.r.t. the value that fills my input field.

I'm asking for a way to do this directly in the OVS method, that is to say, not only call a set_attribute method to fill the inputfield but also, press "enter" to refresh the view.

Hope it's a little bit clear, thanks again for your help.

M.

Former Member
0 Kudos

Hi,

Create an ENTER event for the Input field and Code in it as per your requirement..You can also include the parameters for this method. they will be shown in the method call.

In the OVS, Click on pattern button you can see this method and call the method in the phase 3.

The code is as follows -

data lo_el_context type ref to if_wd_context_element.
 lo_el_context = wd_context->get_element( ).
  wd_this->onactionenter(
    context_element =  lo_el_context                  " ref to if_wd_context_element
    id =  'Test'                              " string   "pass the value as per your requirement
    wdevent =   wdevent                        " ref to cl_wd_custom_event  "Parameter is there in OVS method also pass the same
  ).

I have taken on button and an input field. On the Button action, I called the ENETER event, I'm getting as per my requirement.

If my understanding of your requirement is correct, then the above code works fine for your requirement.Try it out.

Regards,

Lekha.

Answers (0)