cancel
Showing results for 
Search instead for 
Did you mean: 

Strange behaviour of requestFocus

Former Member
0 Kudos

Hi,

I want to set focus on one of the fields in the form. I am using following code:

IWDAttributeInfo attribute = wdContext.nodeNode1().getNodeInfo().getAttribute(IPrivateMyViewView.INode1Element.ATT);

wdThis.wdGetAPI().requestFocus(wdContext.nodeNode1().currentNode1Element(), attribute);

Its working fine most of the time, i.e. , focus is set on the field and cursor also.

But sometimes only the field is surrounded by dotted lines, but cursor is not set at the required field. User has to click & set cursor on this field.

Why is it behaving in such strange way? Setting cursor sometimes and sometimes not? Anyone knows the reason?

Thanks,

Apurva

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Also, before setting focus I am changing lead selection to required row

Regards,

Apurva

Former Member
0 Kudos

As u are setting focus to ui element in table, do not invalidate any thing. it will refresh all data in context.

You mentioned that on click of link a new row is lead selected and focus is set to required field

then you must be setting focus on action of click link after setting new row lead selected.

If this is so then your approach is fine. I have not tried that but i'll try to find out erratic behavior of focus and get back to u

Mandeep Virk

Former Member
0 Kudos

Hi,

Following is what documentation says

"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."

Regards

Ayyapparaj

Former Member
0 Kudos

Hi ayyaparaj,

For my clarification

May be there will more than one UI element of same type

But for reference we are passing attribute info of context element bound to the same UI Element.

Normally one context attribute is not mapped to more than one UI Element, So attribute Info will be unique.

Kindly can u bit explain and clarify this scenario

Thanks

Mandeep

Former Member
0 Kudos

Hi,

Thanks for the reply.

What should I invalidate exactly & how? I don't want to invalidate the context.

If there are more than one elements , & web dynpro is getting focused , then why does it works sometime for same element and sometimes not.

I have a table with column as 'A'. When clicks on link focus should be set on appropriate row , column 'A'.

Sometimes its working for a particular row say row 2. then after some time its not. It just highlights table cell with dotted box(so it has identified the cell requesting focus), but cursor location is not set there.

I am confused. Let me know if more information is required to understand the problem.

Regards,

Apurva

Former Member
0 Kudos

Try using invalidation after completion of one application process.

I mean on click of that button from where u are coming back to same view or completing process.

This my be the case of cache.

Cache may not be getting updated and there may be some data in buffer.

That may be the cause of hindrance in application

Mandeep Virk