cancel
Showing results for 
Search instead for 
Did you mean: 

lose focus when enter the page

Former Member
0 Kudos

hi experts,

in wdDoModifyView i write request focus for input field but when i entering the page, at the first time i can see the focus and after that the focus is disappear. i don't know why and im not doing anything. and when i pressed enter button the page is refreshed

there is my code for setting request focus:

public static void wdDoModifyView(IPrivatePmPartsReplaceTableView wdThis, IPrivatePmPartsReplaceTableView.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)

{

//@@begin wdDoModifyView

// wdThis.wdGetAPI().requestFocus(wdThis.wdGetGetEqpGroupByIdAction());

IWDInputField input = (IWDInputField)view.getElement("EqpId");//Id of Input Field

input.requestFocus();

anyone have this experience?? please help me...

thanks

Edited by: y_ngalam on Jun 10, 2009 12:34 PM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

If you have an action assigned to the onEnter action of the input field you can handle the problem there

Make another call to the request focus inside that action.

the request focus this time its over the context element


IWDAttributeInfo attribute = wdContext.nodeSearchInput().getNodeInfo()
.getAttribute(IPrivateSearchSDCompView.ISearchInputElement.SEARCH_INPUT);
wdThis.wdGetAPI().requestFocus(wdContext.currentSearchInputElement(), attribute);

Edited by: Jean Carlo Abreu on Jun 10, 2009 12:47 PM

Answers (2)

Answers (2)

former_member192434
Active Contributor
0 Kudos

thats becouse of you are seting focus for request once the request is over the focus will be gone you need to set it for application.

Former Member
0 Kudos

Hi,

The code in the wdDoModifyView() executes whenever server round trip happens. Initially while loading the application it will be executed so focus (cursor) coming to your input field. Now if you click on some where else in the screen then automatically you will loose the focus on inputfield. If you click on some button (or any action) if some server round trip happens again wdDoModifyView() will be executed and your inputfield gets the focus again.

Regards,

Charan