cancel
Showing results for 
Search instead for 
Did you mean: 

Localization : error at vehicleType

Former Member
0 Kudos

Hi Friends,

I copied the code and pasted and approaching the way they explained in the PDF , at the vehicleType i am getting an error, any quick idea how to sort this?

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

{

//@@begin onPlugInResult(ServerEvent)

String text, image;

// provides access to translatable texts from Message Pool

IWDTextAccessor textAccessor = wdComponentAPI.getTextAccessor();

if (<b>vehicleType</b>.equals("E")) {

// text = "You have chosen an economy class car.";

text = textAccessor.getText("text_E");

image = "Economy.jpg";

}

else if (<b>vehicleType</b>.equals("F")) {

// text = "You have chosen a first class car.";

text = textAccessor.getText("text_F");

image = "Firstclass.jpg";

}

else if (<b>vehicleType</b>.equals("B")) {

// text = "You have chosen a business class car ";

text = textAccessor.getText("text_B");

image = "Business.jpg";

}

else if (<b>vehicleType</b>.equals("C")) {

// text = "You have chosen a cabriolet.";

text = textAccessor.getText("text_C");

image = "Cabrio.jpg";

}

else { //Van

// text = "You have chosen a van.";

text = textAccessor.getText("text_V");

image = "Van.jpg";

}

wdContext.currentContextElement().setText(text);

wdContext.currentContextElement().setImage(image);

//@@end

}

Many thanks

Peter

Accepted Solutions (1)

Accepted Solutions (1)

lajitha_menon
Contributor
0 Kudos

Hi Peter,

Where is the variable vehicleType declared? The code does not give a declaration for it ..Is it declared as a class variable? If not, it needs to be declared and initialised before it can be used in the method. That could be the problem. Check the tutorial to see where its declared and include it in your code as well.

Hope that helps,

LM

Answers (2)

Answers (2)

Former Member
0 Kudos

You probably forgot to add parameter "vehicleType" to the inbound-plug.

Armin

former_member182294
Active Contributor
0 Kudos

What error your getting? Post the error message.

Regards

Abhilash