cancel
Showing results for 
Search instead for 
Did you mean: 

reportContextAttributeMessage does not highlight field

MG3
Contributor
0 Kudos

Hi

I have a node named Params, and I have created the elements under that dynamically. One of the elements created dynamically is "Rating".

I need to check if the input field(created dynamically) mapped to "Rating" is null or not. if it is null, I need to report a message and highlight the field.

I have a validation helper class, that Im calling, with the method:

public static void raiseError(IWDMessageManager messageMgr, IWDMessage message, IWDNodeInfo node, 
IWDNodeElement element, String fieldName, String fieldLabel) 

IWDAttributeInfo attributeInfo = node.getAttribute(fieldName);
messageMgr.reportContextAttributeMessage(element,attributeInfo,message,new Object[] { 
	fieldLabel },true);

I have done everything thats necessary and am calling the validation class raise error with all the attributes as follows:

ValidationHelper.raiseError(messageMgr, IMessageEmployeeRating.MESSAGE, 
wdContext.nodeParams().getNodeInfo(), wdContext.currentParamsElement(), "Rating"+i, "The rating 
has not been entered");

The problem is that the message "The rating has not been entered" is displayed as expected, but the field is not highlighted or outlined red.

What could be wrong?

BTW, Im on EP 7.00 SP 13.

Thanks

OJ

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos
MG3
Contributor
0 Kudos

Hi Sumit

Thanks for the doc. I have implemented it the same way, but still not happening.

Any other thoughts?

Thanks.

Answers (4)

Answers (4)

former_member214651
Active Contributor
0 Kudos

Hi Jo,

As far as my observations in ur code, when u pass the field name, ur passing it as "Rating"+i. Do u have multiple Rating attributes under ur value node "params"???

If there is no such attribute, i think i will not point to the attribute to which u have mapped.

Regards,

Poojith MV

MG3
Contributor
0 Kudos

Hi Poojith

Yes, "Rating"+i are dynamically created attributes, and I'm trying to access these and highlight them. I even display the name of the attribute on error, and the name of the attribute is correct. But due to some reason, they are not getting marked in red.

Thanks.

Former Member
0 Kudos

Hi,

Just to make sure that it not a bug in your version , can you try to raise the exception with type WARNING and see weather it comes in Yellow.

One more thing when the message is displayed on top does that have a red icon in current state??

Regards

Ayyapparaj

Former Member
0 Kudos

Hi Jo,

Please check whether the 'type' of message defined in the Message Pool is 'error' . If you have selected the type as 'standard', the message will be displayed but the input field will not be highlighted. Hope this will help you.

Regards,

Shabeer.

MG3
Contributor
0 Kudos

Hi Shabeer

Thanks. The message type is error.

OJ

Former Member
0 Kudos

Hi,

Your code looks fine then.

Just check attributeInfo is for the same attribute for which you are checking null.

And element is the current element.

thanks & regards,

Manoj

MG3
Contributor
0 Kudos

Hi Manoj

Yes, the attributeinfo is for the same attribute im checking, and the element is the current element.

Im still not able to fugure out what the problem is.

There was a recent upgrade of patches in my system. Do you think this could have caused it? It was working prior to that. I searched for some docs or Notes on it, but found none.

Thanks.

Edited by: Jo on Jan 29, 2008 4:58 PM

Former Member
0 Kudos

Hi,

What is the code through which you are checking the attribute mapped to inputfield is null or not.

If you add an element for a node, it will be an empty element and not null.

thanks & regards,

Manoj

MG3
Contributor
0 Kudos

Hi Manoj

I am checking if the rating is null or not, and if it is null, it has to display the message.

I even checked the value of Rating, and it is displayed as null. So thats why it goes into the validation and displays the message "Rating is not entered".

Any other thoughts?

Thanks

OJ