Bug 121019 Java based scripting -> TextItemInstance/setText, getText does not work properly
textItemInstance.setText( "Actuate Shanghai" ); System.out.println( textItemInstance.getText( ) ); after executing the codes above, i got "text/template". expected behavior: - Actuate Shanghai actual behavior: - text/template
engine/org.eclipse.birt.report.engine/src/org/eclipse/birt/report/engine/script/internal/ElementUtil.java
import org.eclipse.birt.report.engine.script.internal.instance.GridInstance;
import org.eclipse.birt.report.engine.script.internal.instance.ImageInstance;
import org.eclipse.birt.report.engine.script.internal.instance.LabelInstance;
import org.eclipse.birt.report.engine.script.internal.instance.ListInstance;
import org.eclipse.birt.report.engine.script.internal.instance.RowInstance;
import org.eclipse.birt.report.engine.script.internal.instance.TableInstance;
import org.eclipse.birt.report.engine.script.internal.instance.TextItemInstance;
import org.eclipse.birt.report.model.api.CellHandle;
import org.eclipse.birt.report.model.api.DataItemHandle;
import org.eclipse.birt.report.model.api.DesignElementHandle;
import org.eclipse.birt.report.model.api.GridHandle;
import org.eclipse.birt.report.model.api.ImageHandle;
import org.eclipse.birt.report.model.api.LabelHandle;
import org.eclipse.birt.report.model.api.ListHandle;
import org.eclipse.birt.report.model.api.ReportDesignHandle;
import org.eclipse.birt.report.model.api.ReportElementHandle;
import org.eclipse.birt.report.model.api.RowHandle;
import org.eclipse.birt.report.model.api.TableHandle;
import org.eclipse.birt.report.model.api.TextDataHandle;
import org.eclipse.birt.report.model.api.TextItemHandle;
public class ElementUtil
{
	public static IReportElementInstance getInstance( IElement element )
	{
		if ( element == null )
			return null;
		if ( element instanceof CellContent )
			return new CellInstance( ( CellContent ) element );
		if ( element instanceof DataContent )
			return new DataItemInstance( ( DataContent ) element );