Re: Sending files to server
Thanks, I will try it. I'm sorry that I haven't sent any answer before today (I was on holidays) On Aug 8, 12:41 am, Paul Sullivan [EMAIL PROTECTED] wrote: use the predefined widget http://www.ing.iac.es/gwt-linux-1.4.60/doc/javadoc/com/google/gwt/use... Date: Thu, 7 Aug 2008 04:35:51 -0700 Subject: Sending files to server From: [EMAIL PROTECTED] To: Google-Web-Toolkit@googlegroups.com Hi. I need send a text file, which is on a local folder, from client to server. How can I do that? Maybe my question es stupid, but I'm new in GWT. Any idea is well received. Thanks!. _ Win a voice over part with Kung Fu Panda Live Search and 100’s of Kung Fu Panda prizes to win with Live Searchhttp://clk.atdmt.com/UKM/go/107571439/direct/01/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
How to invoked Double Click and Right Click at the same time.......
I want to invoke Right Click and Double Click on a Horizontal Panel at the same time --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: How to make DialogBox modal both in terms of code execution and events?
I have the same question. I've had to workaround this by adding callbacks to transfer the data from the dialog back to the caller. Regards, lama On Aug 29, 9:16 am, gwt-user [EMAIL PROTECTED] wrote: 1. To illustrate the first point. In the following code: boolean ok = Window.confirm(Are you sure .); if (ok) { } code inside the if block will be executed only after user presses button on the confirm dialog. Is it possible to do the same with instance of DialogBox? 2. The following code DialogBox dialog = new DialogBox(true, true); dialog.show(); does not ignore keyboard and mouse events for widgets not contained by the dialog Thank you, Boris --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: How to make DialogBox modal both in terms of code execution and events?
This is the way it's done. You can think of JavaScript as running on the event-dispatch-thread. Therefore, opening a DialogBox and making the thread wait until a button is clicked results in the following on the queue: ++ +-+ | wait for click | - | click event | ++ +-+ the wait for click will wait for ever since it never lets the thread move onto the click event task and process the actual event. This is a simplification, but in essence the way it works. I wrote about this problem in terms of GWT RPC... but the principal is the same: http://lemnik.wordpress.com/2008/07/04/gwt-rpc-is-called-aynchronous-for-a-reason/ Hope that explains things a bit. lama wrote: I have the same question. I've had to workaround this by adding callbacks to transfer the data from the dialog back to the caller. Regards, lama On Aug 29, 9:16 am, gwt-user [EMAIL PROTECTED] wrote: 1. To illustrate the first point. In the following code: boolean ok = Window.confirm(Are you sure .); if (ok) { } code inside the if block will be executed only after user presses button on the confirm dialog. Is it possible to do the same with instance of DialogBox? 2. The following code DialogBox dialog = new DialogBox(true, true); dialog.show(); does not ignore keyboard and mouse events for widgets not contained by the dialog Thank you, Boris --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: How can I construct a document reader?
Ian, Thank you for your response. I had been thinking along the same lines, but was trying to work out how to replace the links in the menu and the documents (many in the latter are in-page links specified by URL fragments). In the end, it seemed like a lot of potentially fragile work for little gain, so I am implementing a mostly static solution: 1. The menu page and help documents are straight CSS styled XHTML. (Not entirely simple because of the effort to produce reasonable mathematical formulas than can scale as the reader changes the text size. Still, I take care of that and leave the prose to the maintainers.) 2. Because we have a traditional software build process for the complete application set and hosting web site, I have written an XSLT style sheet used at build time to combine the application help menus and the specific help documents the respective menus reference into a set of static XHTML pages containing the bodies of the two combined pages in separate divs. 3. CSS is used to layout the divs and to turn off display of the menu when printing. The upside to this is that the pages are quick and easy to serve and can be readily cached by the browser. However, I still want to use a HorizontalSplitPanel widget in each generated page so that readers with JavaScript enabled can control just how much of the browser window is devoted to the help menu or the help document. I believe that the wrap functions in GWT 1.5 should make that fairly easy to implement. Does anyone have an example or a pointer that demonstrates something like what I want to implement? As for my solution, there are some caveats. The source documents must be well-formed XHTML. Because the ones I need to process are (except for a couple of minor errors caught while working on the XSLT style sheet), this was a fairly easy change to make. Well, fairly easy if you overlook just how difficult it can be to write even a fairly simple correctly working XSLT 2.0 style sheet--especially one that processes multiple source documents into multiple result documents. In fact, that was not the difficult part. The real pain is in dealing with a default XML namespace and with knowing what can be implemented using XPath expressions versus XSLT XML elements or even which XML attributes support the evaluation of XPath expressions or Attribute Value Templates (AVT) or only allow string literals. Frankly, it is a mess. Still, the resulting XSLT style sheet is pretty simple and fairly easy to understand without detailed knowledge of XSLT. Ned On Aug 30, 8:30 pm, Ian Bambury [EMAIL PROTECTED] wrote: Hi Ned, I'd go about it like this: 1.a) Have your index page as the menu with simple anchors pointing to your docs. 1.b) Have the documents as plain html files which view OK without GWT (i.e. with css in there). This will give you your non-JS/Search engine setup. 3) Have your GWT app use a HorizontalSplitPanel to allow resizing between the menu (LH side) and the content (RH side). 4) Have your GWT app pick up all the anchors in the index page and convert them to clickable labels in the LH panel then wipe out that div (or have it hidden, the SEs and non-JS people will still see them) . 5) When you click a label, fetch the html page via RPC or RequestBuilder and on return populate the content panel (RH side), removing whatever is currently there. 6) Implement history and use Hyperlinks to set the menu to load other pages. 2) Use a media=print style sheet to hide the menu panel when printing. Ian 2008/8/30 Ned Nowotny [EMAIL PROTECTED] I have an application today that includes a basic help document reader within it: http://www.quantmethods.com/Demo/Help/ This is implemented entirely with static HTML and a frameset document. However, I want to get rid of the frameset partly to embrace the somewhat overstated need for good web standards hygiene, but mostly to simplify printing of the help pages for my users by using CSS to suppress the menu when printing. (Of course, the user can typically right-click in the help document frame and accomplish the same thing, but most of my users will not be familiar with any of the mechanisms for printing just the help document.) I also want my help document maintainers to continue to use the HTML editor of their choice (within some limits) to edit the documents and I want the menu and pages to be accessible to search engine indexing. To do this, I need the menu and the help pages to remain static HTML. With JavaScript disabled or unavailable, the reader should first view the menu document and then follow the links as necessary to each help document. They can then use the back button or equivalent mechanism to return to the menu. With JavaScript enabled, they should get a two panel reader similar to the current frameset implementation. One additional complication is that new development now
Re: Why servlet?
Basically a servlet is a java class which response to any http browser request by sending back data to this browser. You can compare a servlet to a php page. More info here http://en.wikipedia.org/wiki/Java_Servlet The main GWT feature is the java to javascript compiler to build your client side application… nothing to do with servlet in fact! But real applications need interactions with server to load/save data into a database for example. So GWT provide a basic API to exchange data with any web server. As client is written in java, it’s easier to write your server side code in java too. That’s why a more advanced API exist (see RPC) to call a java method located on your server. Off course, your web server must include a JVM to run java code: have a look on tomcat for that. Vincent On 1 sep, 13:47, Dmitriy R [EMAIL PROTECTED] wrote: I noticed that GWT includes a servlet. What is a purpose of servlet? How it can be deployed? Any restrictions to supported servlet containers? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Best practice: Larger application design
Thanks for all the replies! Can you agree that the following would be a good (very general) design for a somewhat large application with a menu and sub-pages? 1) Each sub page is implemented in its own separate module 2) A general module implements the general application (the menu and right-pane containing the pages) 3) The server-side code for each page is grouped somehow, according to the functionality in the individual pages (however, several pages may perform the same RPC calls, hmm) As you can see, it is still not clear to me. how such a larger application should be structured. I really miss a GWT-template for this (very common) kind of application with * a left menu * a main pane * different pages such as contact form, product catalog, shopping basket, help, etc, and with a proper structuring/partitioning of both client- and server side code. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit commit] r3601 - wiki
Author: [EMAIL PROTECTED] Date: Mon Sep 1 16:53:18 2008 New Revision: 3601 Added: wiki/RpcDirectEval.wiki Log: Created wiki page through web user interface. Added: wiki/RpcDirectEval.wiki == --- (empty file) +++ wiki/RpcDirectEval.wiki Mon Sep 1 16:53:18 2008 @@ -0,0 +1,252 @@ +#summary Change the RPC payload format to executable JavaScript +#labels Phase-Design,RPC + +=Directly-Evalable RPC= + +This project would change the implementation of GWT RPC to use payloads which can be passed directly to the JavaScript eval() function. + + +==Goals:== + + * Preserve 90% compatibility with existing GWT RPC source +* Retire CustomFieldSerializers with a supported replacement + * Reduce size and complexity of client-side code + * Expect to eliminate much of the client-side deserialization logic +* Removal of type-identifying string literals from the RPC payload +* Stop artificially rescuing fields that are referenced only by RPC serialization code + * Ensure that payloads can be incrementally processed to avoid UI delays during deserialization +* No recursive behavior + * Provide per-permutation maps of Java field, method, and class names to (obfuscated) JavaScript names that can be consumed by third-parties +* This opens up the possibility of making non-Java backends speak GWT RPC somewhat feasible instead of outright impossible + * Stretch-goal: Provide prebuilt server-side class files or the ability to synthesize server-side classes to eliminate data- or reflection-driven dispatch + +=Implementation= + +==Pinning constructors== + +GWT RPC serialization implicitly invokes the default constructor (unlike Java serialization). Should we wish to continue this practice in order to preserve source compatibility, we may be able to avoid the need for SerializableTypeOracle to determine which classes are used if we have an explicit GWT.isReachable() or a syntactic equivalent: + +{{{ +package gwtimpl; +// Generated +class RPCSupport { + @SuppressRescue + public static Object constructForRPC(Class? c, JsArray fieldValues) { +if (GWT.isReachable(Foo.class) || GWT.isReachable(FooSuperClass.class) || GWT.isReachable(FooImplementsThis.class)) { + // This could just as easily be setting up a MapClass, Builder + if (c == Foo.class) { +// 80% case of default-serializable objects +return setFieldsFoo(new Foo(), fieldValues); + } else if (c == ClassWithCustomSerializer.class) { +// 20% case of custom serializers +return (new ClientCustomSerializer()).deserialize(constructForRPC(FlattenedFields.class, fieldValues)); + } +} + + // .. + +throw new UnavailableInClientException(c); + } + + // Assuming assignments to unread fields will be deleted and array lookups removed as no-ops + // Ideally, if an object contains no rescued fields or only transient fields, this method will evaporate + @SuppressRescue + private native Foo setFieldsFoo(Foo o, JsArray fieldValues) /*-{ +[EMAIL PROTECTED]::field1 = fieldValues[0]; +[EMAIL PROTECTED]::field2 = fieldValues[1]; +return o; + }-*/; +} +}}} + +==Client-bound (web) payload format== + +The current RPC format is essentially a list of tokens, which requires client-side JavaScript code for dispatch. In deRPC, the client-bound payload will consist of one or more JavaScript statements that, when interpreted via the eval() function, will result in exactly the correct JavaScript object graph that represents the payload. Furthermore, the client-bound payload will be constructed so as to allow for incremental processing of the object graph. + +{{{ +(function payload(){ +// Start with an interned string table +var stringTable = ['hello', 'world']; + +// Back-references are stored in a common table +function group1(constructForRPCFunction, objectTable, payloadTable) { + // constructForRPCFunction is a reference to the above constructForRPC method + // The classRef is a reference to the class literal object for the given type + objectTable[0] = constructForRPCFunction(classRef, [fieldValue, /*unused value*/, stringTable[q]]); + objectTable[1] = constructForRPCFunction(classRef, [objectTable[0]]); + return true; +} + +// Additional groups as desired + +function groupN(constructForRPCFunction, objectTable, payloadTable) { + payloadTable[0] = constructForRPCFunction(classRef, [fieldValue, objectTable[1]]); + return false; +} + +// We replace the //EX and //OK prefixes with a boolean flag +return {shouldThrow = false, functions = [group1, group2, ..., groupN], other: metaData}; +})(); +}}} + +The GWT module would receive the above payload and evaluate it in the lexical context of the module's permutation in the following manner: + +{{{ +class SerializationFunction extends JavaScriptObject { + public final native boolean invoke(JavaScriptObject