w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
  Home » GWT » Page 1
GWT+DataGrid freeze/unfreeze row selection
You can try: NoSelectionModel<Entity> noSelectionModel = new NoSelectionModel<Entity(); ... disableSelection.addValueChangeHandler(new ValueChangeHandler<Boolean>() { @Override public void onValueChange(ValueChangeEvent<Boolean> event) { myDataGrid.setSelectionModel(event.getValue() ? noSelectionModel : selectionModel); } });

Categories : Gwt

GWT - Keep widget instance between modules
A better solution (than keeping global state) would be to use Dependency Injection and inject your widget to all relevant views. Using gin it'd look like this: @Singleton public class CommonWidget { } public class View1 { @Inject public View1(CommonWidget widget) { } } public class View2 { @Inject public View2(CommonWidget widget) { } } Now, widget in View1 and View2

Categories : Gwt

GwtQuery best practice
gQuery is not a framework, just a utility library which adds sugar syntax to Gwt java, so as you can deal with DOM using the popular jQuery API. It also adds some utilities like Promises, Easy Ajax, Json and Xml data binding etc. Said that, the best practices for gwtquery could be: Chose the final architecture in GWT you are happier with. You can use GWT plain widgets, or GWT MVP, GWTP, MGWT, G

Categories : Gwt

Using gwt-jackson without maven
You also have to download the transitive dependencies. Besides of GWT gwt-jackson-0.6.2 depends on jackson-annotations-2.3.3 and jackson-annotations-2.3.3-sources.

Categories : Gwt

GWT/Sencha GXT Text area validation shows false negative
The source of the problem is mentioned in the javadocs for setText (emphasis mine): Sets the underlying DOM field's value directly, bypassing validation. This method does not update the field's value. To set the value with validation see setValue. You should use the setValue(value, true) method instead - true is needed to fire the ValueChangeEvent and trigger validation.

Categories : Gwt

Switching GWT.create(XXX.class) by Custom Annotation
You can achieve this by using dependency injection with GIN. GIN automatically use GWT.create() to create an object that has to be injected. Ex: class MyView { interface MyUiBinder extends UiBinder<Widget, MyView> { } @Inject MyView(MyUiBinder uiBinder) { initWidget(uiBinder.createAndBindUi(this)); } } And with dependency injection, you also specify which imp

Categories : Gwt

GWT - No source code is available for type 'XXX'; did you forget to inherit a required module?
So I found what the problem is, basically its the class name. I am not sure if GWT was unable to recognize the class Evaluation.java because "evaluation" is also in the package name... All I know is that it occured to me that this could be causing the problem and when I changed the name it worked perfectly!

Categories : Gwt

Best practice to creating a phone based application using GWT which will run on both iPhone and android
Take a look to mgwt and their phonegap wrapper. You can also use Closure in combination with GWT, FYI the new Inbox app from Google is about 70% GWT code, 30% Closure.

Categories : Gwt

Detecting Super Dev Mode from within GWT app
Maybe there is an "official" way, but this should work: Storage stockStore = Storage.getSessionStorageIfSupported(); if (stockStore != null) { boolean isSuperDevMode = stockStore.getItem("__gwtDevModeHook:" + GWT.getModuleName()) != null); }

Categories : Gwt

Modify rich text in GWT or smartGWT widget or area
This is a demo of a RichTextArea and RichTextToolbar widgets: http://samples.gwtproject.org/samples/Showcase/Showcase.html#!CwRichText RichTextArea exposes a formatter that can do the things that you need. So if you already have the buttons, you can simply use the formatter to do the work when each button is clicked. UPDATE: For example, if you want to strikeout a selected text or change its c

Categories : Gwt

Handling Browser Refresh in GWT
Take a look at the Activities and Places design pattern for GWT. It is a highly recommended approach that can handle page refreshes as well as back and forward buttons, and allows users to bookmark "pages" within your app.

Categories : Gwt

how to add an onclick event in an implementation of AbstractHasData in gwt
The easiest way is to use a SelectionModel. You can add a SelectionModel to the abstract has data that will handle selection of your summary class. private final SingleSelectionModel<Summary> summarySelectionModel = new SingleSelectionModel<Summary>() { { addSelectionChangeHandler(new SelectionChangeEvent.Handler() { @Override public void onSelecti

Categories : Gwt

Google charts scatterplot turning OFF autoscaling
I figured out how to do this. Create a vertical axis and set the max and min values for that vertical axis. Then use that vertical axis to create the plot. VAxis vaxis = VAxis.create("Occupancy %"); vaxis.setMaxValue(100.0); vaxis.setMinValue(0); occupancyPlotOptions.setVAxis(vaxis); Hope the answer (to my own question) helps other

Categories : Gwt

GXT: Filter Grid add select all columns checkbox
Here's how to do this , override createContextMenu of the GridView ColumnModel<HashMap> cm = new ColumnModel<HashMap>(l); GridView<HashMap> gridView = new GridView<HashMap>() { @Override protected void initHeader() { super.initHeader(); } protected Menu createContextMenu(final int colIndex) { Menu createContextMenu = super.createCo

Categories : Gwt

GWT multiple modules. Specific case of reuse of existing components
To solve the problem I just created 3 modules instead of 2 : a core one that does nothing in onload and contains all the common part, a module A that render the first kind of page application and a module B that does another render in the onload. Such way no interference between A and B and since Core does no render in onload no problem at all

Categories : Gwt

GWT CellTable: How to Update A TextBox Dynamically
ViewData represents a temporary value in your TextInputCell. When you call cellTable.redraw(), the TextInputCell reverts to the original value (the one from getValue() method for that column). Do not redraw the table if you want to modify only the "view" state of TextInputCell, or call accountInvoice.setPayToday# (or whatever method is there) to update the object and then call refresh() on your L

Categories : Gwt

Flextable Formating for proper row and column look and feel
You should use a CellTable or DataGrid widget when you need to display multiple rows of data with column headers. These widgets are specifically designed for this purpose. If, for some reason, you prefer to use a FlexTabel, use CSS to style the header row (height, line-height, etc.)

Categories : Gwt

UiBinder: call method on an object you bind to
You can pass constructor parameters in uibinder http://www.gwtproject.org/doc/latest/DevGuideUiBinder.html#Using_a_widget

Categories : Gwt

How to populate the flex table in GWT from the backend
What's about something like this. In another class you could load your data from backend and create new Car Objekts and pass them to the MyCarFlexTable class. class MyCarFlexTable extends FlexTable { private int rowNumber; private List<Car> cars; public MyCarFlexTable(List<Car> cars) { this.cars = cars; initTable(); } private void initTable() { for(Car c : cars) { //

Categories : Gwt

Upload a file using Drag and Drop on the Browse button in the Browser
You're on the right track, just replace the native GWT code with Smart GWT code. You are mixing GWT with Smart GWT components. You should not do that, per http://forums.smartclient.com/showthread.php?t=8159#aMix. "The reason for this is that there are limits to the maximum degree that two Ajax widget kits (including GWT) can interoperate..." Smart GWT has its own file picker, see http://www.sm

Categories : Gwt

Issue with form based auth and requesting static resource after session timeout
The way I solve it is to only protect the HTML host page with a <security-constraint>. Static resources (images, stylesheets, GWT scripts) aren't protected at all, and AJAX endpoints (GWT-RPC, RequestFactoryServlet, or other endpoints called using AJAX from the app) only check the presence of a user Principal in the request (this can be done in a servlet filter, or a RequestFactory ServiceLa

Categories : Gwt

How to use QuickTip on Grid cell Sencha GXT 3.1.1?
The second try does not work because when you call setToolTipConfig in the QuickTip object it is going to create a new ToolTip for the QuickTip and this is not what we want. In the first case we just need to set autoHide to false, but there is no method to do this in the QuickTip class, so the option is to use the update method like this: QuickTip t = new QuickTip(gridClient); t.setAllowTextSele

Categories : Gwt

Selecting text in TextinputCell in GWT
You can try the following approach: myTable.addCellPreviewHandler(new Handler<MyObject>() { @Override public void onCellPreview(CellPreviewEvent<MyObject> event) { if ("click".equals(event.getNativeEvent().getType())) { if (event.getColumn() == table.getColumnIndex(myColumn)) { InputElement input = (InputElement) getRowElement(event.getInde

Categories : Gwt

GWT Editors: How to record changes to fields and sub-editors? (RequestFactory?)
I believe you could do that using an EditorVisitor, similar to the DirtCollector visitor used internally by the Editor framework (have a look at the PathCollector for how to collect paths in a visitor). I would start by visiting the hierarchy to collect the initial values just after the call to edit() (this is done already by the DirtCollector internally, but there's no way to access its results,

Categories : Gwt

GWT site works fine but will not render in SuperDevMode
Did you use maven? If that's the case, have you lunch your superDevMode server on a container as Tomcat/Jetty ? To see if your superDevMode's server works, you need to go to the url "127.0.0.1/9876". If you have no server which responds that's your superDevMode is not lunch. More information on : http://www.gwtproject.org/articles/superdevmode.html

Categories : Gwt

Issue in customizing default tooltip text of PieChart using gwt-visualization 1.1.2 API
It seems that tooltips are currently not supported in Piecharts (see here for reference). I tested it also in pure javascript and tools are not displayed in Piecharts: http://jsfiddle.net/d9tezLL3/ If you change in the above example from PieChart to ColumnChart it will display the tooltips. All you can do is create a static tooltip actions with PieChart. In general I would recommend to use

Categories : Gwt

GWT/GWT Bootstrap - Pagination (SimplePager)
You have pager = new SimplePager(...), so you have to declare @uiField(provided = true) for pager, and move pager declaration/initialisation into your createTableTask function (pager must be set before initwidget).

Categories : Gwt

GWT textBox with different coloured alpha numerics
You cannot style text inside a TextBox - even "::first-letter" selector does not work on it. You can try to create your own widget which will include a transparent TextBox widget on top of a Label widget, where on each KeyUpEvent in the TextBox you update the Label widget with the corresponding text in different colors.

Categories : Gwt

GWT MVP with cookie and history
You should set a cookie in onModuleLoad() method of your Entry point class - it runs only once when an app is loaded for the first time. There is absolutely no reason to check for this cookie on every navigation action. If you are concerned that you may have to kick out your user while the app is still open, you should do it by throwing a LoginException from your RPC calls. You have to check for

Categories : Gwt

GWT's handler registration in second window
Have you considered using a popup instead of a complete new window? I don't believe communication between different windows is directly supported in GWT. You probably have to build or use a library to communicate via localstorage for example.

Categories : Gwt

GWT onFocus event not getting triggered on text box
You should use the methods provided (for your ease) by GWT: textBox.addFocusHandler(new FocusHandler() { @Override public void onFocus(FocusEvent event) { //Do some operation onFocus event } }); It's part of the HasFocusHandlers which is implemented by quite a few of GWT's widgets. Similar handlers can be found for mouse, keyboard, blur, etc. events. For completeness sake:

Categories : Gwt

How are ClientBundles generated? Should I cache or recreate?
Any caching that needs to be done is done internally - there are static members generated with the ClientBundle implementation itself to ensure that after something is done, it doesnt need to be done again. This applies to ImageResource usage as well as CssResource.ensureInjected. Use them as makes sense for any object - the compiler will do its best to make the cleanest code possible. Where ther

Categories : Gwt

Running GWT application on apache tomcat 8
1.- Yes GWT works perfectly with TC 8.0 2.- Java 8 support will be available in GWT-3.0.0, probably in 2015 Q1. Actually there are patches coming to GWT master trunk related with this. https://gwt-review.googlesource.com/#/c/9260/

Categories : Gwt

Usage of JsniBundle: calling methods on initialized js library
Here's what made it work: change final assignment statement in d3.js library from this.d3 = d3; to window.d3 = d3; and change final assignment statement in dc.js library from this.dc = _dc(d3); to window.dc = _dc(window.d3); I assume this is because of some weirdness around the iframe context that GWT code is executed in, but I'm not totally clear on why it works. I haven't done it yet b

Categories : Gwt

gFlot get color ..when is it attached to DOM in GWT
You should add an AttachEvent.Handler to your Widget: widget.addAttachHandler(new AttachEvent.Handler() { @Override public void onAttachOrDetach(AttachEvent event) { if (event.isAttached()) { // Widget got attached to DOM } else { // Detached } } }); If you are having problems accessing your JSNI wrappers' values (in this case gflot's)

Categories : Gwt

gwt canvas element not working in IE 10
According to the stack trace (which is in dev mode), this is about VML, not Canvas. Whatever drawing library you are trying to use is attempting to interact with VML in IE10, which does not support VML. Can you share the code of how you are talking to the canvas?

Categories : Gwt

Create custom widget and allow nested sub-elements in UiBinder
First thing - <left> and <right> have to be in the same namespace as LeftRightToolbar, so it should be <my:left> and <my:right>. Secondly, you need to annotate two methods in LeftRightToolbar with the @UiChild annotation: @UiChild(tagname = "left") void addToLeft(Widget widget) { left.add(widget); } @UiChild(tagname = "right") void addToRight(Widget widget) { rig

Categories : Gwt

Errors occur during compilation of GWT project (GWT2.6.0) using GXT 3.1.0
Some points regarding your module descriptor: remove the following entry: <inherits name='com.google.gwt.user.theme.standard.Standard'/> As long as you are using only GXT widgets, you don't need them. add a GXT theme: f.e.: <inherits name='com.sencha.gxt.theme.neptune.Theme'/> make sure, you add the neptune theme jar to your classpath use client shares and server packages in your

Categories : Gwt

Deploy GWT menu missing in Luna (Eclipse 4.4)
Try the new community beta release version, has better options and support for SDBG: https://gwt-plugins.github.io/documentation/

Categories : Gwt




© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.