0

Hi, I am learning java and i am stuck at point where i don't know what i am doing wrong. I am trying to get a field that is being populated as True/False from the system to change to Yes/No. I know that i have to put an if/else statement but the problem is I don't know the correct approach to execute this.

This is the code:

strBuff.append("<td   class=\"LABEL\">" + MaterialType.getAttribute("defaultSupplierForMaterial").getAttDisplay() + ":</td><td   class=\"FORMELEMENT\">");
                            if(dataHeaderFlexObject.getString("LCSMATERIALSUPPLIER."+MaterialType.getAttribute("defaultSupplierForMaterial").getColumnPrefix()+MaterialType.getAttribute("defaultSupplierForMaterial").getAttColumn())!=null){
                                strBuff.append(dataHeaderFlexObject.getString("LCSMATERIALSUPPLIER."+MaterialType.getAttribute("defaultSupplierForMaterial").getColumnPrefix()+MaterialType.getAttribute("defaultSupplierForMaterial").getAttColumn()));
                            }
                            strBuff.append("</td>");

True and false is set to the "defaultSupplierForMaterial" and i want to to display yes and no.

Any help out there?

Thanks

Edited by pyTony: fixed formating

2
Contributors
1
Reply
2
Views
11 Years
Discussion Span
Last Post by jwenting
0

The logical choice would be to use the ternary operator here (check your language tutorial to find out what it is and how to use it).

You should also really consider cleaning up your program, it is terrible to read making it hard to understand and maintain.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.