cancel
Showing results for 
Search instead for 
Did you mean: 

Issuing an "input missing" error message in a view!

Former Member
0 Kudos

Hello,

I've created a view in WebDynpro which is composed of one inputfield. I've created a method called checkString(), to check if the value entered in the InputField is valid. I wanted to copy an example i've seen from the same kind. Here is part of the code:

msgMng = wdComponentAPI.getMessageManager();

+ String value = wdContext.nodePurchase().currentPurchaseElement().getAttributeAsText("Stock");+

+ if(value.length() == 0){+

+ msgMng.reportContextAttributeMessage(+

+ wdContext.nodePurchase().currentPurchaseElement().getAttributePointer("Stock"),+

+ IMessagePurchaseSelection.INPUT_MISSING,+

+ new Object [] {"Stock"});+

+ return true; +

+ }+

The problem is i can't permanently modify IMessagePurchaseSelection class (The changes are discarded at every build). I guess in the example i've seen, the INPUT_MISSING constant have been automatically generated, so how can i do the same?

public static final com.sap.tc.webdynpro.progmodel.api.IWDMessage INPUT_MISSING = new com.sap.tc.webdynpro.progmodel.gci.impl.GCIMessage( com.sap.test.glx.tutorial.wdui.purchaseselection.PurchaseSelection.class, "InputMissing", com.sap.tc.webdynpro.services.message.WDMessageType.ERROR );

Best Regards

Jean

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

The problem is i can't permanently modify IMessagePurchaseSelection class (The changes are discarded at every build). I guess in the example i've seen, the INPUT_MISSING constant have been automatically generated, so how can i do the same?

You have to make changes in the Message Pool of your component.(DC).

Regards

Ayyapparaj

Former Member
0 Kudos

Sorry, but i'm new to WebDynpro, so i don't understand what you mean. I wanted to know what's the cause of the problem and where i need to make the changes. By the way, I don't know where is the message pool. Is it in my process modelling or in my WD view? Which changes should i make to this message pool?

Thank you.

Jean

Former Member
0 Kudos

Hi,

Message is pool is visible when you expand your component from webdynpro perspective of the NWDS.

You are not suppose to modify the values existing in the classes as they are generated at runtime, instead you make change to the meta data from where this classes get generated, this metadata is generated out of message pool which is mentioned above.

Regards

Ayyapparaj

Former Member
0 Kudos

Thank you, it's exactly where was the modification that i needed to do in my project!

Best Regards,

Jean

Answers (0)