cancel
Showing results for 
Search instead for 
Did you mean: 

"response cannot be resolved error" in an event handler method in WebDynPro

Former Member
0 Kudos

Hi all,

When I use following event handler method in a WebDynPro, its giving "response cannot be resolved" error. I'm I missing some imports? or some .jar files

Please advise me

Thanks in advance

public void onPlugfromStartView(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

{

//@@begin onPlugfromStartView(ServerEvent)

String firstname = wdThis.wdGetExc_ContectController().wdGetContext().currentContextElement().getCmpCtx_firstname();

String lastname = wdThis.wdGetExc_ContectController().wdGetContext().currentContextElement().getCmpCtx_lastname();

if((firstname != null) & (lastname != null)){

<b>response</b> = "Hello, "firstname" "+lastname;

}else{

<b>response</b> = "Hello, stranger";

}

wdContext.currentContextElement().setCtx_txtviewResult(<b>response</b>);

//@@end

}

Reg,

Naresh

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

From ur code, looks like, u miss the decalration for response.

String response = null;

Add this line before if loop. Others look fine only.

Regards,

Harini S

Former Member
0 Kudos

Thanks Harini....

Answers (1)

Answers (1)

Former Member
0 Kudos

String response = null should help.

Otherwise

try

response = "Hello, " + firstname + " " + lastname;

give appropiate spaces. Cannot see anything else stopping the show.

Regards,

Atul Shrivastava

Former Member
0 Kudos

Thanks Atul..