cancel
Showing results for 
Search instead for 
Did you mean: 

tutorial ErrorBehavior method from tutorial is undefined

Former Member
0 Kudos

Hi,

every time I try to use the <i>reportInvalidContextAttributeMessage</i> method in the ErrorBehavior project, like it is suggested in tutorial 3, NetWeaver Developer Studio informs me that this method is undefined for the type <i>IWDMessageManager</i>.

I did the necessary imports like adviced in the tutorial.

Can anyone please help me in finding a solution?

Regards,

Stefan

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Maksim Rashchynski,

unfortunately your suggest does not work well for me.Maybe I do not understand what you want to tell me.

But I can not find a suitable <i>node<NAME>()</i> like you proposed. My approach over a cast like

<i>IWDAttributeInfo attributeInfo = (IWDAttributeInfo) this.wdContext.currentContextElement().getAttributeValue(fieldName);</i>

failed with an <i>java.lang.ClassCastException</i> during runtime. NetWeaver did not criticize it before.

Regards, Stefan

former_member182372
Active Contributor
0 Kudos

If attribute is in root than:

wdContext.getNodeInfo().getAttribute(fieldName);

Former Member
0 Kudos

Hi all,

thank you. You did a good job and helped my a lot in learning about WebDynpo.

Best regards, Stefan

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi together,

thank you for your answers especially the posted link helped somehow.

I now know that I must use <i>reportContextAttributeMessage</i> instead of the method used in the tutorial.

But I still have a problem with that solution. How can I cast my variable <i>fieldName</i> from <i>java.lang.String</i> to <i>com.sap.tc.webdynpro.progmodel.api.IWDAttributeInfo</i> which is required for the new method I have to use.

Regards,

Stefan

former_member182372
Active Contributor
0 Kudos

Hi Stefan,

wdContext.node<NAME>().getNodeInfo().getAttribute(fieldName);

Best regards, Maksim Rashchynski.

Former Member
0 Kudos

Hi Stefan,

Following are the signatures of the method mentioned by you.

void com.sap.tc.webdynpro.progmodel.api.IWDMessageManager.

reportInvalidContextAttributeException(IWDAttributePointer attribute, WDNonFatalException ex)

Report an exception as error message that is associated with an invalid context attribute value.

Parameters:

attribute is the invalid attribute

ex is the exception raised by some validation routine

void com.sap.tc.webdynpro.progmodel.api.IWDMessageManager.

reportInvalidContextAttributeException(IWDAttributePointer attribute, WDNonFatalException ex)

Report an exception as error message that is associated with an invalid context attribute value.

Parameters:

attribute is the invalid attribute

ex is the exception raised by some validation routine

Following methods are or will be depricated

void com.sap.tc.webdynpro.progmodel.api.IWDMessageManager.

reportInvalidContextAttributeException(IWDAttributePointer attribute, WDNonFatalException ex)

Report an exception as error message that is associated with an invalid context attribute value.

Parameters:

attribute is the invalid attribute

ex is the exception raised by some validation routine

void com.sap.tc.webdynpro.progmodel.api.IWDMessageManager.

reportInvalidContextAttributeException(IWDAttributePointer attribute, WDNonFatalException ex)

Report an exception as error message that is associated with an invalid context attribute value.

Parameters:

attribute is the invalid attribute

ex is the exception raised by some validation routine

Regards

Ayyapparaj

Former Member
0 Kudos

Hi Stefan,

Please check the call of reportInvalidContextAttributeMessage.

I think the tutorial might be using a deprecated version of the function.

Check the following link to find if the function is being used correctly in your tutorial i.e, with new signature.

http://media.sdn.sap.com/html/submitted_docs/60_sp2_javadocs/webdynpro/com/sap/tc/webdynpro/progmode...

Regards,

Shubham