gxt

How to get the row index of selected checkbox on grid GXT

僤鯓⒐⒋嵵緔 提交于 2019-12-12 03:41:59
问题 I am working with GXT (2.2.5) and need to get the row index of chenged checkbox on the grid. What i am doing is to create a grid and apply a GridCellRender to show a checkBox in first column, then when any checkBox change their value (listener at the OnChange event), the row index of changed checkbox must be taken. This is a part of my code by the moment: checkColumn.setRenderer(new GridCellRenderer() { @Override public Object render(ModelData model, String property, ColumnData config, int

Can't parse JSON string to Java/JavaScriptObject in GWT

风流意气都作罢 提交于 2019-12-12 03:24:45
问题 I receive data from the server in JSON and parse using JsonUtils (GWT). They look like this: [{"id":26,"name":"Circle1","description":"Test","type":"CIRCLE","coordinates":[{"latitude":50.364736755649716,"longitude":30.120391845703125}],"radius":6577.427847903551,"userId":1}] I use this code to parse it: JsArray<Geofence> geofenceJsArray = JsonUtils.safeEval(response.getText()); But I can't get access to the list of coordinates. When I call geofenceJsArray.get(0).getCoordinates().size() I

Generator threw an exception while rebinding

纵饮孤独 提交于 2019-12-12 02:32:29
问题 I develop the front-end for the GPS-monitoring system. I need to add the new feature - geofence. I have created geofence model and its PropertyAccess interface. When I compile the project I getting the error: Here is the model of geofence: public class Geofence extends JavaScriptObject { protected Geofence() {} public final native int getId() /*-{ return this.id; }-*/; public final native String getName() /*-{ return this.name; }-*/; public final native String getDescription() /*-{ return

Load HTML from URL into DIV (Java, GWT/GXT)

烈酒焚心 提交于 2019-12-11 23:50:16
问题 How can I load html page and insert its content into div element? I don't want to use ContentPanel.setUrl (for example), because it will create IFrame Is it possible? 回答1: Simply use Gxt's HtmlContainer class and it's setUrl() method: http://dev.sencha.com/deploy/gxt-2.2.1/docs/api/com/extjs/gxt/ui/client/widget/HtmlContainer.html#setUrl(java.lang.String) 回答2: Yes, use RequestBuilder go get content of given url: http://code.google.com/p/google-web-toolkit-doc-1-5/wiki/DevGuideHttpRequests

GXT: UiBinder new instance of a Widget

南楼画角 提交于 2019-12-11 19:52:14
问题 I have a TextField form inside a window. Created with UiBinding. Next to the TextField is a button. I wanted to know if it was possible to create a new TextField widget when that button was pressed using UiBinder? This is what I have: Window class: @UiField TextField text; @UiField HorizontalPanel hPanel; .... @UiHandler("addText") public void onClick(SelectEvent event){ hPanel.add(text); } My UiBinder file: <gxt:Window ...(generic setup)...> <g:VerticalPanel> <gxt:FramedPanel> <container

How to Add Listener to cell in GXT Editable Grid

限于喜欢 提交于 2019-12-11 18:39:34
问题 I am writing code for Editable Grid using GXT.I created one column with TextField as Editor like below: column=new ColumnConfig(); column.setId("checkinTime"); column.setHeader("Check In Time"); column.setWidth(80); column.setMenuDisabled(true); column.setSortable(false); final TextField<String> text = new TextField<String>(); column.setEditor(new CellEditor(text)); configs.add(column); Now I need to add Listener to the cell of this column to validate the value of the cell and need to reset

Issue in customizing default tooltip text of PieChart using gwt-visualization 1.1.2 API

房东的猫 提交于 2019-12-11 18:25:37
问题 I am having difficulty in customizing default tool tip text of PieChart.Here are the details of of API: gwt-visualization 1.1.2, Gwt2.0 and Gxt 2.1.1. Here is the link what i have followed , but there is no luck. Code: JSNI: private native DataTable addTooltipColumn(DataTable data) /*-{ data.addColumn({type: 'string', role: 'tooltip'}); return data; }-*/; DataTable: private AbstractDataTable createTable() { DataTable data = DataTable.create(); data.addColumn(ColumnType.STRING, "Task"); data

How to add an image as a background for the cell in the GXT 2.2 Grid

穿精又带淫゛_ 提交于 2019-12-11 16:19:46
问题 I wanted to add the button to the cell but now I'm ready just to set an image for the background of the cell and than handle the click. how to add the image to the cell? 回答1: If you want to render a button in a column, see setRenderer method of ColumnConfig . The following will set a button on each row of the grid: ColumnConfig cfg = new ColumnConfig(); cfg.setRenderer(new GridCellRenderer() { @Override public Object render(M model, String property, ColumnData config, int rowIndex, int

Error HTTP 404 (“Script Tag Failure - no status available”) in GWT application

南笙酒味 提交于 2019-12-11 11:57:02
问题 In our application we use Sencha GXT and GWT 2.7. Unfortunately there's often the following error displayed in a pop-up: Download of /path/deferredjs/SOMEGENERATEDID failed with status 404 ("Script Tag Failure - no status available") It only seems to occur when a new version of the application has been deployed. Clearing the browser cache solves the problem. I found out that this error occurs in the class ScriptTagLoadingStrategy.java in GWT. Is there another way to solve this problem other

ClassCastException when comparing Dates?

99封情书 提交于 2019-12-11 09:50:01
问题 I am using GXT/ExtGWT. I have below code which compares two dates. private DateField startDateField = new DateField(); private DateField endDateField = new DateField(); Date date = new Date(); CalendarUtil.addDaysToDate(date, -1); startDateField.setValue(date); endDateField.setValue(new Date()); Date fromDate = startDateField.getValue(); Date toDate = endDateField.getValue(); Date differenceBetweenDates = new Date(fromDate.getTime()); CalendarUtil.addMonthsToDate(differenceBetweenDates, 6);