gwt

Parsing user time input in Java/GWT

社会主义新天地 提交于 2019-12-24 03:24:13
问题 What is the best way to parse time that a user typed in a text field in GWT? Default time formats require users to enter time exactly as the time format for locale specifies it. I want to be more flexible as there are many different ways users can enter time. For example, entries like "8", "8p", "8pm", "8.15pm", "13:15", "1315", "13.15" should be valid. 回答1: I ended up with my own method that I want to share. This method returns time in milliseconds, which can be displayed using any data

GWT capturing drag & drop events

梦想的初衷 提交于 2019-12-24 03:05:17
问题 I'm trying to capture dragover and drop events. Right now I'm capturing those events adding a dom handler to my RootLayoutPanel: dragOverHandler = RootLayoutPanel.get().addBitlessDomHandler(this, DragOverEvent.getType()); dropHandler = RootLayoutPanel.get().addBitlessDomHandler(this, DropEvent.getType()); The problem is this code does not capture the events when showing a popup and the drag/drop is over the popup itself or the glass around it. I have also tried using a native preview handler,

garbled css name when styling within UiBinder

我与影子孤独终老i 提交于 2019-12-24 02:40:32
问题 For my GWT application, I want to show the selected row in a FlexTable, and for that purpose I add a style to the specific row: @UiField FlexTable productTable; int row; [...] /* select row */ productTable.getRowFormatter().addStyleName(row, "row-selected"); In the corresponding ui.xml file, I have the style added as follows: ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder" xmlns:g="urn:import:com.google.gwt.user.client.ui" xmlns:u="urn:import:myapplication.client.ui"> <ui:style> tr.row

How do I add MouseEvents to an AbsolutePanel?

别说谁变了你拦得住时间么 提交于 2019-12-24 01:57:15
问题 How do I add MouseEvents, specifically MouseOutHandlers to an AbsolutePanel without creating a Composite widget? Or is this possible? From what I can tell it involves adding a DomHandler, and a HandlerRegistration. A detailed example would be greatly appreciated considering I am quite new GWT and Java. Thanks, Eric 回答1: You have to create custom AbsolutePanel. Follow the code.I think this should work.Now you can add mouse out handler to absolute panel.If you want to use all Mouse events

What is the difference between RemoteServiceServlet and RemoteService?

℡╲_俬逩灬. 提交于 2019-12-24 01:26:26
问题 I know that the first one is a class and the second is an interface but the point is, why should client Services extends the RemoteService and for the ServiceImpl class extends RemoteServiceServlet So What is Actually behind the Scene ?! 回答1: You're trying to compare apples and oranges. Please read docs and make any simple demo project to clearly understand these concepts. RemoteService is the interface that RPC interfaces on client side should extend. And RemoteServiceServlet is the servlet

How to Upload a file in GWT

会有一股神秘感。 提交于 2019-12-24 01:25:57
问题 I have to Upload a file which can be of type , Doc, text. The Size of the File is more the 1 MB. I need the name , size , and the data of this file on sever side so that i can process it further. How to do it? What libaries i use for this. Any sample code will be of great help. 回答1: Checkout Basic File upload in GWT Refer this also : An Example 来源: https://stackoverflow.com/questions/9615567/how-to-upload-a-file-in-gwt

How to programmatically disable html caching with GWT

感情迁移 提交于 2019-12-24 01:24:13
问题 Is there a way to disable the caching of html pages in the browser with GWT ? I'd rather avoid using inserting META HTTP-EQUIV="EXPIRES" CONTENT=... in the header of my html pages, and do it programmatically instead - if possible. 回答1: I'd be surprised, if this is possible (and has any effect) with GWT/JavaScript, because it would mean, that the question if and how long the page will be cached can change dynamically while the user views the page. But even if it is, it won't work with proxies,

Handle Authorization in GWT application

大兔子大兔子 提交于 2019-12-24 00:58:19
问题 I am planing to use JAAS for authorization purpose. I am using GWT on GUI side and Java on server side. Please suggest some code to handle authorization using JAAS. Does it has support for GWT?. Is there any way to control disable and enable button using JAAS? Does any library available to handle authorization for GWT appliation?. 回答1: AFAIK there is no library in GWT that handles authorization. That's also not really straightforward as authorization is mainly handled on the backend and there

ByteBuffer to String in GWT

隐身守侯 提交于 2019-12-24 00:57:38
问题 On a PlayN project I have the following Java code import com.google.common.base.Charsets; import java.nio.ByteBuffer; ByteBuffer msg = ... // a ByteBuffer that contains a String String s = Charsets.UTF_8.decode(msg).toString(); this works fine in Java, but when I try to compile it with GWT I get: The method decode(ByteBuffer) is undefined for the type Charset What's the proper way, in GWT, to obtain a String (encoded in UTF-8) that's inside a ByteBuffer? 回答1: You should be able to use new