cancel
Showing results for 
Search instead for 
Did you mean: 

About reportInvalidContextAttributeException

Former Member
0 Kudos

hi everyOne!!

I'm going to check table column properties(like inputfield) using <b> invalidContextAttributeException</b> in IWDMessageManager.

Is it possible? If possible, please explain required steps in detail.

Thanks.

regards bk Kim.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos
Former Member
0 Kudos

thank you for your reply.

but it is not the answer that i want.

What i want to know is how to use invalidContextAttributeException in

column of table.

Regards,

BK Kim.

Former Member
0 Kudos

BUB,

In general, your code should be like this:


wdComponentAPI
  .getMessageManager()
    .reportInvalidContextAttributeException(
      element, attrInfo, "Hey, type something valid!", false
    );

If I understand correctly, the question is what <i>element</i> and <i>attrInfo</i> to use.

First is simple. Table UI control is bound to node via dataSource property, every element in node correspond to row in table. So, if you are reporting error about 15th element then use

wdContext.node<TableNodeName>().getElementAt(15)

or if you are reporting error about currently selected element then use

wdContext.current<TableNodeName>Element();

Attribute info is a bit tricker. You may use different table cell editors for every column. Every cell editor has some "default" property that is bound to data attribute. So IWDInputField has "value", IWDDropDownByKey has "selectedKey". To highlight necessary cell editor (sure, in correct column) you must use attribute that is binding source of this default property.

For example, your column uses IWDInputField as editor, and IWDInputField.value is bound to attribute with name "EmpName". Then attrInfo is

wdContext.node<TableNodeName>().getNodeInfo().getAttribute("EmpName");

So we get the following code snippet as example:


wdComponentAPI
  .getMessageManager()
    .reportInvalidContextAttributeException(
      wdContext.current<TableNodeName>Element(), 
      wdContext.node<TableNodeName>().getNodeInfo().getAttribute("EmpName"), 
      "Hey, type something valid!", false
    );

Valery Silaev

SaM Solutions

http://www.sam-solutions.net

Answers (1)

Answers (1)

Former Member
0 Kudos

mission complete.