Please use https://groups.google.com/d/forum/google-web-toolkit to ask for
support. This group is for contributions to GWT.
On Tuesday, July 9, 2013 4:26:07 PM UTC+2, Prabhu Kumar Gade wrote:
>
>
> I have writen one program using gwt-visulization to gwt table. In that
> table it is allow html code.In that code to how to call the gwt method
>
> see the following program:
> package com.sample.client;
>
> import com.google.gwt.core.client.EntryPoint;
> import com.google.gwt.i18n.client.NumberFormat;
> import com.google.gwt.user.client.Window;
> import com.google.gwt.user.client.ui.RootPanel;
> import com.google.gwt.user.client.ui.ScrollPanel;
> import com.google.gwt.user.client.ui.VerticalPanel;
> import com.google.gwt.visualization.client.AbstractDataTable.ColumnType;
> import com.google.gwt.visualization.client.DataTable;
> import com.google.gwt.visualization.client.VisualizationUtils;
> import com.google.gwt.visualization.client.visualizations.Table;
> import com.google.gwt.visualization.client.visualizations.Table.Options;
>
> public class Gwtgooglechartsexample implements EntryPoint
> {
> ScrollPanel scrollPanel=new ScrollPanel();
> VerticalPanel vpanel=new VerticalPanel();
> CenterPopupPanel popup=new CenterPopupPanel();
> public void onModuleLoad()
> {
> RootPanel.get().add(vpanel);
> vpanel.add(scrollPanel);
> showTable();
> //exportMyFunction(this);
> }
> private void showTable()
> {
> Runnable runnable=new Runnable()
> {
> @Override
> public void run()
> {
> final Table table = new Table(createDataTable(),
> createTableOptions());
> scrollPanel.clear();
> scrollPanel.setWidget(table);
> }
> };
> VisualizationUtils.loadVisualizationApi(runnable, Table.PACKAGE);
> }
>
> private DataTable createDataTable()
> {
> DataTable dataTable = DataTable.create();
> dataTable.addColumn(ColumnType.STRING, "Items");
> dataTable.addColumn(ColumnType.STRING, "Prices");
> dataTable.addColumn(ColumnType.STRING, "Return Qty");
> dataTable.addColumn(ColumnType.STRING, "Sold Qty");
> dataTable.addColumn(ColumnType.STRING, "Required Qty");
> dataTable.addRow();
> dataTable.setValue(0, 0, "<a
> href='javascript:callPopup()'>item1</a>");
> dataTable.setValue(0, 1, "<center>100</center>");
> dataTable.setValue(0, 2, "<center>1</center>");
> dataTable.setValue(0, 3, "<center>2</center>");
> dataTable.setValue(0, 4, "<center>3</center>");
> dataTable.addRow();
> dataTable.setValue(1, 0, "<script type='text/javascript'>function
> myFunction(){alert('Welcome ')}</script><a
> href='javascript:myFunction()'>item2</a>");
> dataTable.setValue(1, 1, "<center>200</center>");
> dataTable.setValue(1, 2, "<center>2</center>");
> dataTable.setValue(1, 3, "<center>3</center>");
> dataTable.setValue(1, 4, "<center>2</center>");
> return dataTable;
> }
> private Options createTableOptions()
> {
> Table.Options options = Table.Options.create();
> options.setShowRowNumber(true);
> options.setSortAscending(true);
> options.setSortColumn(1);
> options.setWidth("100%");
> options.setHeight("100%");
> options.setAllowHtml(true);
> return options;
> }
>
> public static float getFormatted(float value) {
> NumberFormat fmt = NumberFormat.getFormat(".00");
> String val=fmt.format(value);
> if(val.contains(","))
> {
> val=val.replace(",", "");
> val.trim();
> }
> return Float.parseFloat(val);
> }
> public void callPopup()
> {
> Window.alert("test");
> /*popup.setVisible(true);
> popup.show();
> popup.center();*/
> }
> public static native void exportMyFunction(Gwtgooglechartsexample x)
> /*-{
> $wnd.callPopup
> =$entry([email protected]::callPopup()());
> }-*/;
> }
>
>
>
>
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors
---
You received this message because you are subscribed to the Google Groups "GWT
Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.