on 08-19-2008 8:24 PM
On my WebDynpro App i have an input field that I want to have focus when it is displayed.
On the Implementation section I have this init code
public StartView(IPrivateStartView wdThis)
{
this.wdThis = wdThis;
this.wdContext = wdThis.wdGetContext();
this.wdControllerAPI = wdThis.wdGetAPI();
this.wdComponentAPI = wdThis.wdGetAPI().getComponent();
}
I'm thinking I should add something like:
wdComponentAPI(name).getfocus();
Anyone get what I'm talking about?
Mike
Hi,
You can try it:
IWDInputField field=(IWDInputField)view.getElement("InputId");
field.requestFocus();
Put this code on wdDoModifyView of your View class. This method pass parameter firstTime, you can use its to set focus only at the first load.
Best regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Are you using the firstTime parameter to execute this code only at first time?
public static void wdDoModifyView(IPrivate<view name> wdThis, Iprivate<view name>.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)
{
//@@begin wdDoModifyView
if (firstTime){
// Execute the code
}
//@@end
}
I have this implememted, but when i push the button it takes me back still.
public static void wdDoModifyView(IPrivate<view name> wdThis, Iprivate<view name>.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)
{
//@@begin wdDoModifyView
if (firstTime){
// Execute the code
}
//@@end
}
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.