cancel
Showing results for 
Search instead for 
Did you mean: 

Set Focus on input field

Former Member
0 Kudos

is it possible to programatically set the focus on an input field ?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Yes its possible use the requestFocus method

https://help.sap.com/javadocs/NW04s/current/wd/com/sap/tc/webdynpro/progmodel/api/IWDViewController....

Ex:

wdThis.wdGetAPI().requestFocus(nodeElement, attribute);

Regards

Ayyapparaj

former_member185086
Active Contributor
0 Kudos

Hi

try this

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

{

//@@begin wdDoModifyView

if (firstTime) {

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

input.requestFocus();

}

//@@end

}

Best Regards

Satish Kumar

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi All,

I am able to set focus on the UI element(Message Area) at run time in the browser window through Request focus method. But when i am running the same application through portal, I am not able to focus on the UI element.Moreover, this method is only applicable for View. So, if I want to print any message in my Component controller what should i DO?

Since, it is not supporting it.

Please send your pointers as soon as possible.

Your replies will be highly appreciable.

Former Member
0 Kudos

Plz see the below thread