gwt

In GWT how do I handle the tab click event?

谁说我不能喝 提交于 2019-12-24 00:51:33
问题 I have a tab layout panel in my ui.xml : <g:TabLayoutPanel ui:field="tabPanel" barHeight='30'> <g:tab> <g:header size='7'>tab1</g:header> <g:SimplePanel ui:field="tab1" height="100%"/> </g:tab> <g:tab> <g:header size='7'>tab2</g:header> <g:SimplePanel ui:field="tab2" height="100%"/> </g:tab> </g:TabLayoutPanel> how do I handle the event generated on clicking Tab2? 回答1: Handle the SelectionEvent<Integer> or BeforeSelectionEvent<Integer> depending on your requirements. e.g: tabPanel

GWT Servlet-based Notification (Server Event Bus)

与世无争的帅哥 提交于 2019-12-24 00:49:27
问题 Can anyone think of a good way to allow the server to notify the client based upon server processing? For example, consider the following events: A user requests a deletion of data, however, due to it's long-running time, we kick it off to a queue. The client receives a "Yes we completed your transaction successfully". The server deletes the item and now wants to update any local structures any clients may be using (I'd also like to notify the user). I know this can be done by client-side

Session management in GWT client side

淺唱寂寞╮ 提交于 2019-12-24 00:46:06
问题 I am building a GWT application where I have 3 RootPanels one of which contains the login panel (userId and Password). My application is a one page application. In order to login the user's id and password is varified from the server through RPC and if the combination is correct the next Panel loads which is my main application. Since it is a one page application, I want to know how should I carry out session management in this application. 回答1: Few ways I used in my different GWT

Weird error with Locale.getISOCountries()

戏子无情 提交于 2019-12-24 00:43:30
问题 I'm using this code: for (final String code : Locale.getISOCountries()) { //stuff here } But on compile I get this error: [ERROR] Line 21: No source code is available for type java.util.Locale; did you forget to inherit a required module? And then a stack trace of compiler errors. I'm doing both of these imports at the beginning of the class: package com.me.example; import java.util.Locale; import java.util.*; What can be wrong? In Netbeans i see the autocomplete options and no syntax error

Using Java.util.scanner with GWT

若如初见. 提交于 2019-12-24 00:38:22
问题 for some reason when I try to use scanner with gwt, i get the following error: No source code is available for type java.util.Scanner; did you forget to inherit a required module? I looked around and it seems the "No source code is available for type xxxx" errors are due to not having a Javascript equivalent type for the Java type. Is scanner not able to be used with GWT? Here is a snippet of my code: import java.util.Scanner; ... public void submit(){ String text = editor.getEditor().getText

How to disable all widgets inside Panel or inside Composite?

老子叫甜甜 提交于 2019-12-24 00:34:09
问题 I have a composite widget, which contain many widgets (inside HorizontalPanel ). How to disable all widgets inside HorizontalPanel or inside this composite? I can't find setEnabled() method in Composite or panels 回答1: The only way to do it is to recursively get all children of the panel and call setEnabled(false) on each widget, which extends FocusWidget 回答2: I'm sure you've already figured it out, but if anyone else is curious, this will enable or disable all nested FocusWidgets: private

Making Cross Site Asynchronous HTTP Post from GWT Client

删除回忆录丶 提交于 2019-12-23 23:52:54
问题 I m working in a GWT based Project and i'm used to making RPC requests alone. I tried creating a new project and making Cross Site request with GWT client using RequestBuilder, but i couldn't get it to work. I'm not really good with GWT. So Please can anyone tell me how to create a new Project and its settings along with the code for Making Cross site requests from GWT Client(completely removing RPC calls) ..? I've went through google and stackoverflow, but no complete thing on this topic. It

org.datanucleus.sco.backed.ArrayList cannot be cast to java.util.Set

时光怂恿深爱的人放手 提交于 2019-12-23 23:32:56
问题 Since 4 days ago, in random short periods of time , my deployed application is throwing this error: org.datanucleus.sco.backed.ArrayList cannot be cast to java.util.Set We are using GWT 2.4 / Java 1.7 (We recently migrate from 1.6 to 1.7) It happens when retrieving or persisting an entity with a String set: import java.util.HashSet; import java.util.Set; ... @PersistenceCapable(identityType = IdentityType.APPLICATION, detachable = "true") public class DbAccount { @PrimaryKey @Persistent

placing widget in listbox/dropdown in gwt

点点圈 提交于 2019-12-23 23:15:19
问题 i am using gwt to build my web site. i would like to create a dropdown/listbox that contains no just text but also images, meaning that in the drop down there will be a what ever widget that ill create. please advise jaimon 回答1: You won't be able to do this with a ListBox, because it just creates an HTML < select> element. You can use a MenuBar that has one menu with MenuItems in it to simulate a dropdown with complex widgets inside it. You will also be able to style the dropdown rather than

Does GWT reuse Google Closure Compiler, and why if not?

流过昼夜 提交于 2019-12-23 23:10:56
问题 Google Web Toolkit (GWT) performs inlining of javascript code, minifying and removing unused code, and some other optimizations which are also done by Google Closure Compiler. So I was wondering if Closure Compiler is in fact utilized in GWT or do they have two separate implementations? If so, then what is the restriction/reasoning for not reusing Google Closure Compiler in GWT? 回答1: Commit 10778: Closure JS hookup hooks GWT to the closure compiler. Probably with GWT 2.5, at least behind the