gwt

How to get week of year figure in GWT

江枫思渺然 提交于 2019-12-23 17:14:41
问题 Is there a simple way how to get week of year information from a Date object or from millis time in GWT on the client side? 回答1: Something like this: Date date = new Date(); Date yearStart = new Date(date.getYear(), 0, 0); int week = (int) (date.getTime() - yearStart.getTime())/(7 * 24 * 60 * 60 * 1000); Note that this will give you a week in a Date object, which has no time zone information. When you use it, you may have to adjust it using the time zone information. 回答2: How to do it with

How can I connect GWT to CometD/Bayeux events?

旧城冷巷雨未停 提交于 2019-12-23 17:07:00
问题 I've got a GWT application, which periodically needs to update the screen with new tick items as they come in. We also have messages published by a CometD/Bayeux server (for a different AJAX application) and I'd like to consume them in my GWT. Of course, I can drop into JavaScript, hook up Dojo, and receive callbacks in the JavaScript layer - and from there, route a call into GWT Java code via a JSNI - but there doesn't appear to be any support in GWT directly for using long push or async

how post entire page in GWT form panel

别来无恙 提交于 2019-12-23 15:29:47
问题 While using GWT FormPanel, after submitting the form, it posts form but does not redirect to the action url. Can any body help me? 回答1: formPanelObject.getElement().<FormElement>cast().setTarget(""); by this line you changing the target parameter of the form and now the main page redirected to the action url after calling formPanelObject.submit();. 来源: https://stackoverflow.com/questions/11890068/how-post-entire-page-in-gwt-form-panel

How to unescape string in GWT

*爱你&永不变心* 提交于 2019-12-23 13:23:16
问题 I used SafeHtmlUtils.htmlEscape(text) and I want to use opposite function. Could you tell me if in gwt there is function like unescapeHtml() 回答1: If (and please only if) you can trust the text not to contain malicious content, you can use import com.google.gwt.user.client.ui.HTML; String unescaped = new HTML(text).getText(); 回答2: If nothing has been done to do this trick (say some GWT project around), you can implement it in a JSNI method using javascript snip you can found here : [CSS/HTML

Localization of GWT app built with UiBinder doesn't work in hosted mode

痞子三分冷 提交于 2019-12-23 12:59:28
问题 Does localization of GWT app built with UiBinder work in hosted mode ? It does not for me. Here is what I did: 1) Added locale properties to GWT module's XML < inherits name="com.google.gwt.i18n.I18N" / > < extend-property name='locale' values='en'/> < extend-property name='locale' values='ru'/> < set-property-fallback name="locale" value="en"/> 2) Taged messages in *.ui.xml files with , as < ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder" ui:generateFormat="com.google.gwt.i18n.rebind

gwt> importing a sample project

耗尽温柔 提交于 2019-12-23 12:38:50
问题 I'm just barely after 2 hours of trying to force it to work and looking for answers online. How in the world do you import a sample gwt application into your eclipse and make it run? by the way, I cannot find "projectCreator.cmd" anywhere in my files, where is it suppose to be assumming i've used eclipse plugin updater to d/l gwt 1.7.1? 回答1: Well, this is what I ended up doing though it ugly and probably not how it was meant to be: I create a new application called it "bla" or whatever then

How do you let UiBinder pass tags without binding them so XFBML works?

北战南征 提交于 2019-12-23 12:36:39
问题 I have an application designed that's using GWT and UiBinder. Now we're trying to setup a login through facebook. I've included the script to init the fb javascript in my application's HTML, and I'm trying to get a facebook login button. The Login.ui.xml contains a facebook login tag: <ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder' xmlns:g="urn:import:com.google.gwt.user.client.ui" > <g:HTMLPanel addStyleNames="login"> <h2>Login Using Your Account</h2> <g:TextBox ui:field="username"/>

GWT - Implementing a DialogBox for Login purposes

给你一囗甜甜゛ 提交于 2019-12-23 12:34:48
问题 For testing purposes, I want to use a DialogBox for logging into my application. Here's the uibinder file: <!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent"> <ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder" xmlns:g="urn:import:com.google.gwt.user.client.ui"> <ui:style> </ui:style> <g:HTMLPanel> <g:Label>Username</g:Label> <g:TextBox ui:field="username"></g:TextBox> <g:Label>Password</g:Label> <g:PasswordTextBox ui:field="password"></g:PasswordTextBox> <g:Button ui

classNotFoundException GWTBridge

霸气de小男生 提交于 2019-12-23 12:34:27
问题 im working on a gwt webapp and while working on it im getting this exception while trying to get a XML file from a URL in a remove servlete. i dont know much about the underworkings of gwt, maybe someone can help me out this is the code to get the data from the url public static String readURL(String path) throws IOException{ String data = ""; URL url = new URL(path); URLConnection conn = url.openConnection(); BufferedReader br = new BufferedReader(new InputStreamReader( conn.getInputStream()

How to know which element is being displayed in GWT ScrollPanel

混江龙づ霸主 提交于 2019-12-23 12:31:17
问题 A question about GWT ScrollPanel. Is there any way to determine which child element is being displayed in ScrollPanel? (Of course, ScrollPanel contains DecoratorPanel that has HTML object) 回答1: AFAIK there is no built-in functionality to do so, not in DOM nor in GWT. If you have fixed height elements you might try to calculate if certain element is shown: Check if element is visible after scrolling 回答2: Here's the GWT method that does the Job (it is translated from the JQuery solution