gwt

One to Many relationship JPA/Hibernate removing links

吃可爱长大的小学妹 提交于 2020-01-15 05:03:07
问题 I have bidirectional relationship setup as follows: class Child{ @ManyToOne @JoinTable(name = "CHILDREN_WITH_PARENT", joinColumns = {@JoinColumn(name = "CHILD_ID")}, inverseJoinColumns = {@JoinColumn(name = "PARENT_ID")} ) private Parent parent; } class Parent{ @OneToMany(mappedBy="parent", cascade=CascadeType.ALL) Set<Child> childrens = new HashSet<Child>(); public void persistOrMerge() { EntityManager em = entityManager(); em.getTransaction().begin(); try { if (em.contains(this)) return; if

LibGDX Uncaught RunTime Exception in HTML Deployment

夙愿已清 提交于 2020-01-14 09:48:08
问题 I seem to be getting an error when deploying my game to HTML. The menu screen works fine, then the transition to the game screen causes this error. Text from console : Uncaught java.lang.RuntimeException: com.google.gwt.core.client.JavaScriptException: (TypeError) gwt$exception: <skipped>: Cannot read property 'get_5' of null The errors seem to pile on by the millisecond as the window is kept open. The game runs perfectly on Desktop (windows and mac), Android, and iPhone. Not sure what's

Drag and Drop file upload with GWT

南笙酒味 提交于 2020-01-14 09:31:47
问题 I'm trying to implement a drag-and-drop file upload for my GWT app. I've tried http://www.vectomatic.org/gwt/lib-gwt-file-test-latest/lib-gwt-file-test.html http://map-notes.blogspot.com/2013/01/minimal-implementation-of-file-drag-and.html However the demo itself does not work. What are my options for implementing this for my app without using any Flash solution. 回答1: I use the GWT Uplader - http://www.moxiegroup.com/moxieapps/gwt-uploader/ If the browser is capable of handling file uploads

GWT - RPC - get servlet absolute path to make dir

坚强是说给别人听的谎言 提交于 2020-01-14 09:08:02
问题 I tried to read a file with my "RemoteServiceServlet" but the thing is I want to create a dir which path is related to servlet like absolute_servlet_path/myPackage/ But the problem is... code like ServletContext servletContext = this.getServletContext(); String pathContext = servletContext.getRealPath(""); ... gives not "C:/..." but "/" only so the code cannot be used with java.io.File object. So my question is how can I use java.io.File with RemoteServiceServlet ? 回答1: OK... I had to keep

GWT - RPC - get servlet absolute path to make dir

为君一笑 提交于 2020-01-14 09:07:30
问题 I tried to read a file with my "RemoteServiceServlet" but the thing is I want to create a dir which path is related to servlet like absolute_servlet_path/myPackage/ But the problem is... code like ServletContext servletContext = this.getServletContext(); String pathContext = servletContext.getRealPath(""); ... gives not "C:/..." but "/" only so the code cannot be used with java.io.File object. So my question is how can I use java.io.File with RemoteServiceServlet ? 回答1: OK... I had to keep

GWT Popup window in new browser window

北战南征 提交于 2020-01-14 07:40:51
问题 I am trying to open new pop up window (browser window ) on click of button . Please suggest how to impement it. 回答1: This should give you the basic idea on how to do this. Button openWindow = new Button("Open Window"); openWindow.addClickHandler(new ClickHandler() { public void onClick(final ClickEvent clickEvent) { Window.open("http://google.com", "_blank", null); } }); RootPanel.get().add(openWindow); 回答2: Using Window.open() inside a Button's ClickHandler should do the trick. 回答3: We have

using GWT RPC mechanism with my customized Servlet

元气小坏坏 提交于 2020-01-14 05:10:10
问题 I currently have a GWT application which uses the RequestBuilde to send messages to a servlet I have (using POST and GET ), and my servlet (in doPost and doGet ) "pauses" the request (this is done by using Servlets 3.0 spec) and adds it to a queue. Additionally I have a Daemon thread which runs in the background and "plays" the request when there is new data. This works great for me apart from the fact that I'm just sending strings for now and I'd like to utilize the RPC mechanism to send

Register KeyDownHandler on GWT VerticalPanel

こ雲淡風輕ζ 提交于 2020-01-14 03:26:13
问题 I have a gwt VerticalPanel class that i need to handel KeyDown events for it. the method i used to implement keyboard handler in my class is: i add : this.sinkEvents(Event.ONKEYDOWN); to constructor then i override method onBrowserEvent() to handle key down event. @Override public void onBrowserEvent(Event event) { // TODO Auto-generated method stub super.onBrowserEvent(event); int type = DOM.eventGetType(event); switch (type) { case Event.ONKEYDOWN: //call method to handle this keydown event

How must one use a ListEditor as a child of another Editor?

安稳与你 提交于 2020-01-13 19:39:27
问题 I am using GWT 2.5.0 My intent was to create an editor hierarchy which binds to a ParentBean object. The ParentBean contains a List<Group> , and the Group bean has a List<ChildBean> and List<Group> . From the Editor tutorials I have found, it seemed simple enough to create an editor which contains a ListEditor as one of its sub-editors. But the parent editor never seems to properly initialize the sub ListEditor. Here is an explanation of how I attempted to do this. From the code below, I

Debugging a GWT application in a remote environment

空扰寡人 提交于 2020-01-13 15:05:39
问题 I have deployed my GWT application to its target environment (i.e. compiled and copied the war directory contents to the target device's /var/www ) and some parts of it are not working. I understand that I can debug my local instance of the GWT app as if it were running in the target environment, by opening the deployed GWT App URL and adding gwt.codesvr URL parameter to it, like this: http://deployment_host/gwtapp.html?gwt.codesvr=localhost:9997 I get Plugin failed to connect to Development