cancel
Showing results for 
Search instead for 
Did you mean: 

How to set the focus on an input field

Former Member
0 Kudos

Hi,

I offer in my WD UI an input field with standard F4 help.

After value is selected from the selection dialog, the focus is not set on the

input field to induce the enter action.

Does anybody know whether this is a bug? If not how to set the focus in this case?

many thanks for help and kind regards,

Sahla

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Sahla,

As far as I have understood ur input field is not getting populated after u select a value from selection dialog.

Please tell what type of search help u are using.

If it is an OVs plz make sure u set the context attribute with the selection list value in phase 3 of OVS lifecycle.

I hope it helps.

Please revert back with issues.

Regards,

Sumit Oberoi

Former Member
0 Kudos

Hi Sumit,

I am sorry for the formulation of my question.

No the value is populated. My problem is rather a pure UI problem.

After having selected the value, I have to click on Enter to trigger the onEnter Action of the input field.

My problem is that the focus of the mouse is not set on the input field element after having selected the value.

The user has to click on the input field to activate it then click on enter.

I hope I could better explain the scenario.

kind regards,

Sahla

alejandro_bindi
Active Contributor
0 Kudos

What kind of search help it is? Check out in the context attribute.

I don't know with the rest of them, but in the case of DDIC search helps, the focus should indeed be placed automatically in the inputfield when you select some value, i've tested it on the system i'm using. I'm on SP12, maybe you're at a lower level. Another possibility may be that some other part of your code is enforcing the focus on a specific field. Search for REQUEST_FOCUS method calls on the view controller.

Regards

Former Member
0 Kudos

Hi,

thank you for your hints,

1) The value help I used was automatic. The WD runtime found out the correct way to display value help.

Now I changed it to ddic help. But same behavior. Focus is not set on the input field after value selection.

2) I don't know which SP version I am using. how to find it out?

3) I think I have to set the focus explicitly using the proposed method request_focus. Where to do it and how?

I did the following: I have an attribute a_cockpit_view in the component controller

of type IF_WD_VIEW_CONTROLLER containinig the controller of the view that contains the input field.

In the function WDDOMODIFYVIEW of the view I set the component attribute of the component controller to the api of the view.

I call then the function request_focus:

wd_comp_controller->a_cockpit_view->request_focus

with the context element and attribute that are bound to the input field.

nothing changes!! the focus is not set!!!

The focus has to do with the ui element rathr than with the context element.

Am I misunderstanding something?

What am I doing wrong?

kind regards,

Sahla

(PS: I am new to the field)

Former Member
0 Kudos

Hi Sahla,

I am not getting why this is happening.

As said above please check for any request_focus call in ur controller.

Also make sure it is not happening due to any code written in WDDOMODIFYVIEW.

I would suggest you to run the debugger. See very carefully that what is happening with respect to focus.

As a last option use the function FOCUS_BY_CONTEXT_ELEMENT of class CL_WD_INPUT_FIELD to set the focus on input field using the context attribute.

I hope it helps.

Regards,

Sumit Oberoi

alejandro_bindi
Active Contributor
0 Kudos

Sahla, about the points you mention:

1) You may set it back to automatic as this makes no difference.

2) Menu System -> Status... -> Magnifier icon on the right -> Check the Level column of component SAP_BASIS.

3) You seem to be setting the focus properly...however, you shouldn't need to.

Anyway, AFAIK there are two ways to set the focus: with the method you mention, using a context element (which can be called from anywhere) and using an UI element (which can be called only from WDDOMODIFYVIEW: VIEW->REQUEST_FOCUS_ON_VIEW_ELEM).

Regards

Edited by: Alejandro Bindi on Aug 8, 2008 10:24 AM

Former Member
0 Kudos

Hi again,

Thank you very much for responding.

unfortunately nothing works!!!

I am developing using SAP_BASIS 701.

Here again the whole scenario:

1) I have a context node in the component controller with name MDM_SYSTEMS containing an attribut MDM_SYSTEM.

The attribute of the context node has following help properties:

Input Help Mode = Dictionary Search Help

Dictionary Search Help = SMSY_EL_SYSTEM

2) This node is bound to the context of the view controller.

3) The view defines an input field with ID= MDM_SYSTEM whose value is bound to the context attribute MDM_SYSTEM

(Sorry, names are exactly the same, by coincidence -- I hope this is not THE problem)

4/a) in wddomodify of the view I tried the first alternative:

DATA lo_ui_element type ref to if_wd_view_element.

lo_ui_element = view->get_element(

id = 'MDM_SYSTEM' ).

if lo_ui_element is bound.

view->request_focus_on_view_elem( lo_ui_element ).

endif.

--> doesn't work. The focus is not set

4/b) in wddomodify I tried the second alternative:

DATA lo_view_contr TYPE REF TO if_wd_view_controller.

DATA lo_nd_mdm_systems TYPE REF TO if_wd_context_node.

DATA lo_el_mdm_systems TYPE REF TO if_wd_context_element.

lo_nd_mdm_systems = wd_context->get_child_node( name = wd_this->wdctx_mdm_systems ).

lo_el_mdm_systems = lo_nd_mdm_systems->get_element( ).

lo_view_contr = wd_this->wd_get_api( ).

lo_view_contr->request_focus(

exporting

context_element = lo_el_mdm_systems

attribute = `MDM_SYSTEM`

)

.

--> doesn't work, too!!!

5) In my view I have in addition to the input field a viewcontaineruielement in which I embend a powl_master interface view. This is the only place wher I lose control.

But I checked all wddomodify functions of the related views in the POWL_UI_COMP: None of them set the focus.

6) @ Sumit: what would be a smart debug strategy, just going with F6 didn't help me: I don't understand anything from all the WD stuff behind.

I am slowly getting in trouble, because I have to finish this point very soon.

Does anyone of you have a little time to start a netmeeting and have a direct look?

kind regards,

Sahla

Former Member
0 Kudos

Hi,

I found out, that this is a well known - client dependent- problem that i right now in

processing by the WD ABAP rendering group.

Can you tell me which client are you using?

I am using the internet explorer version 6.0.2900.2180, SP02.

kind regards,

Sahla

alejandro_bindi
Active Contributor
0 Kudos

Same IE version in here...

Regards

Former Member
0 Kudos

This is really very very very strange!!!