cancel
Showing results for 
Search instead for 
Did you mean: 

IWDMessageManager in WDJ Tutorial #3(Simple Input Form), p.23

Former Member
0 Kudos

Prior to typing in any of the code shown on page 25 of WDJ Tutorial #3, the generated Java code looks like this for the checkDateInPast method:

-


//@@begin javadoc:checkDateInPast()

/** Declared method. */

//@@end

public void checkDateInPast( java.lang.String fieldName )

{

//@@begin checkDateInPast()

//@@end

}

-


When I type in the first line of the code to be added, the result looks like this:

-


//@@begin javadoc:checkDateInPast()

/** Declared method. */

//@@end

public void checkDateInPast( java.lang.String fieldName )

{

//@@begin checkDateInPast()

IWDMessageManager msgMgr =

wdComponentAPI.getMessageManager();

//@@end

}

-


But right away I get this error message:

-


"IWDMessageManager cannot be resolved or is not a type."

-


I have checked back carefully on previous pages and don't see anything I've neglected to do.

Can someone suggest what might be going on here, either an error in the tutorial or an error in something I've done ????

Thanks

Dave

Accepted Solutions (1)

Accepted Solutions (1)

former_member181923
Active Participant
0 Kudos

Near the top of p.23, the tutorial says:

"Note the source code block between //@begin imports and //@end for importing used Java classes."

But it doesn't say what import statement(s) should be added to this block, if any.

Is this the problem? Does an import statement have to be added here?

If so, what is the statement?

Former Member
0 Kudos

You don't have to add import statements manually, just press CTRL-SHIFT-O (Organize imports).

Make sure that the //@@begin imports section never gets totally empty, because then the "Organize imports" adds the import statements outside of the UCA (user coding area) and they get lost when the WD code generation runs.

Armin

former_member181923
Active Participant
0 Kudos

Yes - that did it, thanks.

Before you answered I found another way - I looked back at the Java for the views in previous tutorials and found these statements:

import com.sap.tc.webdynpro.progmodel.api.*;

import com.sap.tc.webdynpro.progmodel.gci.*;

import com.sap.tc.webdynpro.progmodel.context.*;

When I added these, the error message went away also - obviously because the IWDMessageManager is included in progmodel.api.*

But while you're around let me ask you the following question:

When I do it your way (ctrl-shift-o), how does NWDS know to add just the line for the MessageManager:

"import com.sap.tc.webdynpro.progmodel.api.IWDMessageManager;"

Thanks.

Dave

lajitha_menon
Contributor
0 Kudos

Hi David,

You can also organize imports by right-clicking on your source and choosing source->Organize imports.

It is a standard Eclipse feature I guess, to organize your code. It adds the import statements you are missing. If multiples exists, it will give you a dialog box for you to choose the class you want to import.

Regards,

LMenon

former_member181923
Active Participant
0 Kudos

Thanks for the right-click alternative, LM. I like it better than those old three-key commands that turn my fingers into pretzels.

So the underlying Eclipse framework must be pretty well-written to be able to find what import statements are missing so quickly. I'm not sure I recall any similar feature in the Borland Turbo line for the C family, but it's been a while so I may well be mistaken.

Thanks again

Dave

Answers (0)