cancel
Showing results for 
Search instead for 
Did you mean: 

wdThis.wdGetAPI().requestFocus() Doesn't work when using Message Manager

Former Member
0 Kudos

Greetings

In CE 7.1 Webdynpro Java for an application that runs in PieClient I used the below code.


wdThis.wdGetAPI().requestFocus(wdContext.currentHand_Add_MaterialsElement(),
wdcontext.nodeHand_Add_Materials().getNodeInfo().getAttribute(IPrivateMixersView.IHand_Add_MaterialsElement.MATNR));

As soon as an action that throws an error message or information message or warning message using Message Manager is triggered the request focus method doesn't place the cursor in the desired input field.

Kindly help me out.

Tx.

Best Regards

Ramamoorthy D

Accepted Solutions (1)

Accepted Solutions (1)

former_member214651
Active Contributor
0 Kudos

Hi Durai,

The IWDAttributeInfo is deprecated in CE7.1. use can try following code:

//For Node Validations

IWDAttributePointer <Object>= wdContext.node<NodeName>().get<NodeName>ElementAt(i).getAttributePointer("<Attribute>");

//For Attributes

IWDAttributePointer <Object>= wdContext.currentContextElement().getAttributePointer("<Attribute>");

messageManager.reportContextAttributeMessage(<Object>,<message>,<args>);

Hope this helps u.

Regards,

Poojith MV

Former Member
0 Kudos

Thanks again for the reply. I will try and update.

Best Regards

Ramamoorthy D

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

I tried following code in one of my application and its working fine. Please check if its helpfull.

In wdDoModifyView method write the code below:-

IWDInputField InputField = (IWDInputField) view.getElement("if_Name");

InputField.requestFocus();

Regards,

Swati Gaur

Former Member
0 Kudos

Thanks for your response.

I shall try this one out and get back.

Best Regards

Ramamoorthy D

Former Member
0 Kudos

Swati

I tried what you have given, as soon as error messages display the cursor navigation is lost from the screen. I need to point the mouse manually to enter information. The application is used in handheld, to use pointer in touch screen seems to be very difficult for the end users.

Tx again for your valuable reply.

Best Regards

Ramamoorthy D

former_member214651
Active Contributor
0 Kudos

Hi Durai,

try using the reportContextAttributeMessage() API for acheiving what u want:

Eg:

IWDAttributeIfo object = wdContext.currentContextElement().getNodeInfo().getAttribute("<Attribute to set focus>");

if(<condition>)

{

---<messageManagerObject>.reportContextAttributeMessage(<attributeInfoObject>,<message>,<parameters>,<cancelNavigation>);

}

Hope this helps you.

Regards,

Poojith MV

Former Member
0 Kudos

Thanks for your reply, I shall try this option and get back.

Best Regards

Ramamoorthy D