cancel
Showing results for 
Search instead for 
Did you mean: 

info on reportInvalidContextAttributeException

Former Member
0 Kudos

Hi All,

We have many inputfields on the UI , these inputfields are in different tabs of a tabstrip.

We have validation in place .We want to get focus to the respective input field when the message manager complains about some validation.

We are using reportInvalidContextAttributeException method but this doesn't set focus to the inpurfield in a particular tab.

Any inputs ? Does this supports in CE 7.2 ?

Anil

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member214651
Active Contributor
0 Kudos

Hi,

use the following code to set the focus on error:

IWDAttributePointer attrField = wdContext().currentContextElement().getAttributePointer("<name of the attribute>");
if(condition)
{
    wdComponentAPI().getMessageManager().reportContextAttributeMessage(attrField, IMessage<componentname>().<messageID>, <dynamicParameters>);
}

Regards,

Poojith MV

Former Member
0 Kudos

This doesn't help.

In our scenario, messageManager displays the error message saying that one of the inputfield is blank.When the user clicks on the message it should set the focus to the respective input field.

setting the focus is not working when the input field is different tab. It works only when the inputfield is in current tab strip

Regards, Anil

former_member214651
Active Contributor
0 Kudos

Hi,

In that case u will have to print the error message along with the tabname where the Input field is present or use the "Selected Tab" property.

The "Selected Tab" property can bound to a context attribute and depending on which Input field is blank, u can set the selected property to the tab name containing the Input field.

Regards,

Poojith MV