on 07-31-2006 4:48 PM
Hi,
I'm using this code to move the focus on a specific IUElement:
IWDAttributeInfo attribute = wdContext.nodeZ_NouInteressat().getNodeInfo().
getAttribute(IPrivateDadesClient.IZ_NouInteressatElement.VKORG__001);
wdThis.wdGetAPI().requestFocus
(wdContext.currentZ_NouInteressatElement(),attribute);
But, How can I know where the focus is?
Thanks,
Ricard.
Oscar (or Ricard ,
There is no built-in way to get current focus.
However, you can track focus yourself up to certain extent.
Any time action is invoked, it occurs on element in focus: onAction in Button/Link2Action, onSelect in DropDown, onEnter in InputField. So if you use separate action handler for every control, or use add parameter to action to return ID of UI control, you may track control that fired action and hence focused. Special handling must be done for controls inside Table.
So it is possible even it's quite complex. Then only question is "What's for?"
VS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi everybody,
In my form there are several InputFields and DropDownByKey. My objective is that whenever the user pushes the Intro key, the cursor moves to the following IUElement.
To do that, I created a string[] that contains the name of each control (ordered by the position on the screen). When an Intro is performed, I need to know on which control has done it. After that, I search the control name into the string[] and I put the focus on the following IUElement of the string[].
I think that is a workaround, but I dont know any other way to implement that behavior under WD.
Thanks,
Ricard.
Oscar/Ricard
You can try something like this:
In your wdDoModifyView() write a code like this:
if(firstTime){
IWDInputField input = (IWDInputField)view.getElement("Input1");
input.mappingOfOnEnter().addParameter("uiElementID",input.getId());
//do the same for all inputfields.
IWDDropDownByIndex drop = (IWDDropDownByIndex)view.getElement("Drop1");
drop.mappingOfOnSelect().addParameter("uiElementID",drop.getId());
//do the same for all dropdowns.
}
Now assuming that your onEnter and onSelect eventhandler is the same, it should do something like:
public void onActionEnter(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, java.lang.String uiElementID ){
wdComponentAPI.getMessageManager().reportSuccess("Fired from:" + uiElementID);
//do further processing.
}
Regards,
Satyajit.
Hi Ricard,
I don`t thik it is possible on WD server side.
Best regards, Maksim Rashchynski.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.