cancel
Showing results for 
Search instead for 
Did you mean: 

how to get UI element clicked by the user

Former Member
0 Kudos

Hi Experts ,

I want to know which UI element in my wed dynpro application is currently having focus. Is there any method (like get focus ) available?

How to know which UI element is clicked by the user?

Thanks in advance.

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi RK ,

I have four input fields which are bind to same context node. Depending on the fiels on which user clicks ,I want to do further processing .So I want to know currently selected UI element by the user.

Thank in advance.

Former Member
0 Kudos

hi,

Put the processing you want to do inside onEnter for eacnh of the input fields

Regrds

Bharathwaj

Former Member
0 Kudos

Hi,

I am refering to UI element input field which has OVS help. I want to know whether user has clicked on the input fiels or not .

Thanks in advance.

Former Member
0 Kudos

That's currently not possible. What do you want to achieve?

Armin

Former Member
0 Kudos

Hi ,

I don't want to set focus on particular field .

I want to know on which field currently focus is .

Thanks in advance .

Former Member
0 Kudos

Hi Kebdurkar

Check this info may help you

<b>requestFocus</b>

public void requestFocus(IWDAction action)Requests to change the keyboard input focus to the UI element whose primary purpose is to raise an event bound to the given action. If there is more than one such UI element, then it is undefined which UI element is chosen. It is also undefined which focus request wins if there are several ones. The request may silently fail, but is guaranteed not to throw an exception. UI elements (e.g. table) that trigger events (e.g. "onLeadSelect"), but are not primarily used to do so, are probably considered with lower priority or not at all. As a rule of thumb, if disabling the action disables the whole UI element, then that UI element is primarily used to trigger the event bound to that action. Example: If you have a button whose "onAction" event is bound against the action XYZ and no other UI element event is bound against XYZ, then a wdThis.wdGetAPI().requestFocus(wdThis.wdGetXYZAction()) will focus on that button. Note how this allows to keep controller code independent of the UI, even of IDs used for UI elements. If the button in the example above is later replaced by a LinkToAction or some fancy new icon button that lives inside a tray's header, the code to request focus remains unaffected.

<b>requestFocus</b>

public void requestFocus(IWDNodeElement nodeElement,

IWDAttributeInfo attribute)Requests to change the keyboard input focus to the UI element whose primary use is to edit a property bound to the given attribute. If there is more than one such UI element, then it is undefined which UI element is chosen. It is also undefined which focus request wins if there are several ones. The request may silently fail, but is guaranteed not to throw an exception. UI elements that are read-only or disabled are not considered at all. To identify a given attribute uniquely at runtime, you must specify the node element to which that attribute belongs. This will e.g. identify a specific cell in a given table row. Example: If you have an input field whose "value" property is bound against the attribute abc of node XYZ of this view called MyView and no other UI element property is bound against XYZ.abc, then the following code will focus on that input field.

IWDAttributeInfo attribute

= wdContext.nodeXYZ().getNodeInfo().getAttribute(

IPrivateMyView.IXYZElement.ABC);

wdThis.wdGetAPI().requestFocus(wdContext.currentXYZElement(), attribute);

Note how this allows to keep controller code independent of the UI, even of IDs used for UI elements. If the input field in the example above is later replaced by a DropDownByKey or some fancy new editor with "guess what I want" value help, the code to request focus remains unaffected.

Regards,

RK

Former Member
0 Kudos

No, you can only request focus for a UI element. Which kind of UI element do you refer to?

Armin

Former Member
0 Kudos

Hi

u have a method called requestFocus which takes ur control to the UI Element u want to set.

U can call this method with the UI Element.

Like IWDViewElement.requestFocus();