Skip to main content

Home/ Groups/ GWT - Samples
Esfand S

how to enable scrolling for app using DecoratedTabPanel? - Google Web Toolkit | Google ... - 1 views

  • There is two type of layouts: RIA-like and web-page-like. The RIA-like layout is done using the layout panels. The app stretch to the whole available space. There is no scrollbars. The web-page-like layout is done using HTML tags (and some standard panels). The app don't stretch. If the content is larger than the viewport, scrollbars appears, like in traditional pages. Looking at the first screenshot, here is my proposal: 1) The main panel is a DockLayoutPanel attached to RootLayoutPanel. 2) The north slot contains the header. 3) The center slot contains a TabLayoutPanel. But when you show data (list, form...) you may have no enough space to show all. Here you start to use web-page-like layout. So: 4) The contain of the contact tab is a LayoutPanel with four slot: Tighformat, the list, Detail view, Relations. 5) Tighformat, Detail view and Relations are standard panels (FlowPanel) into ScrollPanels. If there not enough space, a scrollbar will appear. 6) The list is some sort of DockLayoutPanel with the headers top, the navigation buttons bottom and the contains of the list in the center with a scrollbar is needed. The exact implementation depends on the used widget for the list (SmartGWT, GXT, gwt-incubator...)
Esfand S

Google Web Toolkit (GWT 2.0) with Eclipse - Tutorial - 0 views

  • The standard approach in Java is to have separated projects for separate purposes. For example the domain model of the application is usually defined in its own project.
  • This chapter describes how you can make these projects available to the GWT compiler as modules.
  • GWT need to have access to the source files to compile them into Javascript code. If you add the project or the jar file to your GWT classpath then the Java compiler will not complain if you use the classes from the included project / jar but the GWT compiler will not be able to compile them. To make the Java files available to the GWT compiler you need to Create a gwt.xml file in the Java project / jar file which you want to use - This will instruct the GWT compiler to use the listed classes. Use the included library via the inherit definition If you are using a jar file you also need to include the source files in the jar
Esfand S

GWT History | GWT Tutorials - 0 views

  • GWT handles the browser’s history stack by changing the hash, which is always preceded by the “#” symbol. While the JavaScript community call it a hash, GWT calls it a token, but regardless of what you call it, the token is how you are going to update the state of your web application.
  • The way in which you are going to capture changes in history is through the ValueChangeHandler. You will need to implement the ValueChangeHandler in your EntryPoint class,
  • The next step is to implement a function that will handle the logic of your state changes. So I am going to create a new method called onHistoryChange and I am going to pass in an argument called token. You will see why it is not recommended to write your logic in the onValueChange method in a moment.
  • ...2 more annotations...
  • The next step is to initialize the state of your web application using the history stack.
  • AJAX history logic can get confusing quickly, so you should have a good plan in place before writing the logic.
Esfand S

Anchors in GWT | GWT Tutorials - 0 views

  • The primary reason why I am writing a specific tutorial on the Anchor widget is because without it you will not be able to easily use GWT’s history framework
  • let’s talk about a hash, and how to use them. Since GWT is an easy way to use AJAX we are going to stay within that realm when talking about the hash. A hash is simply anything with the pound symbol in front of it. For example “#gwt” is a hash that points somewhere in your web application. We are going to learn more about the hash in the tutorial on GWT history.
  • Anchor anchor = new Anchor("GWT Tutorials", "http://www.gwttutorials.com?action=hello", "_blank");   String paramAction = Window.Location.getParameter("action");   //Do something with paramAction.
  • ...1 more annotation...
  • So basically the way this works is that you can create a new Anchor widget and append a parameter to it. In your onModuleLoad function you can get the parameter from the window’s location, and then use this parameter to load a different state of your application. To create a parameter just append a “?” then the name of the parameter and finally the value of the parameter. Also you can include multiple paramters by using the “&” symbol, so for example you could do this: “?action=hello&noaction=bye”.
Esfand S

Raible Designs | JSON Parsing with JavaScript Overlay Types in GWT - 0 views

  • we're using Overlay Types to simplify JSON parsing and make our application lean-and-mean as possible
Esfand S

My First GWT IGoogle Gadget, What do you think? - Google Web Toolkit | Google Groups - 0 views

  • I built a basic and more complex gadgets which are demoed here. More Info here: http://code.google.com/p/gwt-examples/wiki/project_Gadget?ts=12722477... Basic Gadget is released here: IGoogle Directory: http://www.google.com/ig/directory?url=demogadgetmathflashcard.appspo...
Esfand S

Rich Internet Applications (RIA) » Blog Archive » GWT UiBinder: Better Web Ap... - 0 views

  • Mixing HTML and Widgets So how can we mix widgets and html properly? Before GWT version 2.0, the most common way was to use “RootPanel.get(’someId’)” to access an HTML element in the application host page, and then create an object there to attach the widgets to (ie. a “RootPanel”). If we need to embed only a few widgets in the host page, this technique suffices. But doing this in a real application with a large number of widgets becomes complex and slow. UiBinder scales better because it does not inject widgets into the HTML of the host page. Instead, you declare your layout in a stand-alone HTML file that can be composed with other components as many times as necessary to build more complex interfaces. Composition entails componentization, allowing the developer to create subparts of the user interface (UI components) that can be packaged, re-used and tested in isolation.
Esfand S

Using GWT Events | GWT Tutorials - 0 views

  • all event handlers are abstract classes, so you must implement the abstract functions. For example, the onClick method is abstract, so you need to implement it in your ClickHandler class, as well as define what the onClick method is going to do.
Esfand S

Using Event Handlers in GWT-1.6 « Lemming Technology Blog - 0 views

  • event dispatching and handling has become much easier with Handlers. You can invent your own Event types, and use them in the same way as all the other Handlers.
  • When the value of any TextBox changes I want to do something with the value but i need to know the row number of the changed TextBox
  • You maybe want the Grid to rather extend Composite and fire the onValueChange() events, that way you only need one ChangeHandler listening on all the TextBox’s (rather than one Handler per TextBox).
Esfand S

TreeItem (Google Web Toolkit Javadoc) - 0 views

  • public class TreeExample implements EntryPoint { public void onModuleLoad() { // Create a tree with a few items in it. TreeItem root = new TreeItem("root"); root.addItem("item0"); root.addItem("item1"); root.addItem("item2"); // Add a CheckBox to the tree TreeItem item = new TreeItem(new CheckBox("item3")); root.addItem(item); Tree t = new Tree(); t.addItem(root); // Add it to the root panel. RootPanel.get().add(t); } }
Esfand S

Simple working example of the Data Presentation Widget CellTable - Google Web Toolkit |... - 0 views

  • protected void init() {                 VerticalPanel container = new VerticalPanel();                 initWidget(container);                 int pageSize = 10;                 CellTable<User> cellTable = new CellTable<User>(pageSize);                 setColumns(cellTable);                 setSelectionModel(cellTable);                 setDataSize(cellTable);                 int pageStart = 0;                 loadData(pageStart, pageSize, cellTable);                 SimplePager<User> pager = createPager(cellTable);                 container.add(cellTable);                 container.add(pager);         }
Esfand S

GWT JSNI | GWT Tutorials - 0 views

  • JSNI gives you the freedom to pick and choose which GWT capabilities you want to use.
  • JSNI is base on Java JNI which allows you to declare a Java method, but implement the definition in another language.
  • entire JavaScript libraries have been implemented into GWT with the use of JSNI.
Esfand S

GWT UiBinder "helloworld" with HTML « Iqbalyusuf's Blog - 0 views

  • 11public class MyHTMLBinder extends UIObject {12 13    interface MyHTMLBinderUiBinder extends UiBinder<Element, MyHTMLBinder> {}14    private static MyHTMLBinderUiBinder uiBinder = GWT.create(MyHTMLBinderUiBinder.class);15 16    @UiField SpanElement nameSpan;17    @UiField SpanElement greetingSpan;18    @UiField DivElement divElement;19 20    public MyHTMLBinder(String firstName) {21        setElement(uiBinder.createAndBindUi(this));22 23        greetingSpan.setInnerText("Hello there ");24        nameSpan.setInnerText(firstName);25        divElement.setInnerHTML("<p> Hope you had a good time </p>");26 27    }28 29}
Esfand S

developerlife - Tutorials » GWT Tutorial - Managing History and Hyperlinks - 0 views

  • GWT provides a way for your apps to hook into the browser’s history mechanism, so that you can control what happens when a user hits Back or Forward in their browser. You can also programmatically manipulate the browser’s history, and even create hyperlinks in your apps that can hook into the browser’s history mechanism. You can even intercept these hyperlinks when a user clicks on them, instead of having the browser handle it, or both.
  • tokens allow you to map a specific state of your application to what’s in the browser’s history stack. When your app starts up, the stack is empty. When the user interacts with your app, and clicks on something, you can add tokens to this stack (either via hyperlinks or calls to History.newItem(String token)). This lets you change the history. You can also attach a HistoryListener to your app which will allow your app to respond to this change of history.
  • Why do it this way? I mean, if your app generates the tokens themselves, why not just change the state instead of dealing with receiving a history change notification (that you just initiated) and then respond to it? A good reason for taking the trouble to do this, is to allow people to bookmark certain states of your application. If you don’t want them to do this, then you can just plug into the history mechanism, and then ignore all the history state change events, and make it so that the Back or Forward button does not mess your app up.
  • ...7 more annotations...
  • If there are tokens in the history stack, and the user presses the Back button, or you invoke the History.back() method, then the following steps occur: a token is retrieved from the top of the stack this token (which is just a String) is then passed to your HistoryListener implementation, and this is how you know that the Back button is pressed. You then have to parse that token and change the state of your application to match what this token represents to your app.
  • no matter what happens, all these Back/Forward actions (whether initiated programmatically by your app, or by a user) ends up calling your HistoryListener’s onHistoryChanged(String token) method, which can act as a traffic cop of your state machine. You are in control of defining what a token is, and how it should map to various states in your application. You can encode parameters in the token and then parse them out later, to understand what your app is supposed to do now.
  • If you noticed the change in the browser’s displayed URL, when a hyperlink with a history token is clicked, then can see how the user is able to bookmark a specific state in your app… the token is simply added to the URL in the browser prefixed with a “#”. So, is it possible to add your own history token by typing in the URL for your app and just appending “#mynewtoken” to it? Yes! This is how GWT handles people bookmarking specific states of your application. One thing to keep in mind is that if you end the browser session, and then come into the app, then your app will have to process the initial history state, and it will have to check to see if there is “#mynewtoken” passed in the URL to the browser, and then adjust it’s state accordingly
  • you can hook into this mechanism and make it possible for the app to go to a particular state or load a particular resource or perform a function based on what is passed as a token to the URL.
  • You can use pass parameters to your app via the URL (here’s a coding quickie that shows you how), and you can use it along with tokens, but it’s bit confusing to use both.
  • let’s use this URL as an example: http://localhost:8888/Sample.Client/index.html#link2token?p1=v1&p2=v2 When you run the app with this URL, you will get the following string as the token: “link2token?p1=v1&p2=v2“. So as you can see it’s not a great idea to mix the two. This is the kind of URL that’s generated by the GWT Hyperlink class, so you can’t really mix and match query strings with history tokens.
  • If you want to create the URL yourself, then you can pass history tokens and query strings. In order to do this, you have to make sure to place the query string (?p1=v1&p2=v2) before the “#” in the URL and it will work. If you use this URL as an example: http://localhost:8888/Sample.Client/index.html?p1=v1&p2=v2#link2token When you run the app with this URL, you will get the following string as the history token: “link2token“. And a call to GWTUtils.getParamString() will return “?p1=v1&p2=v2“.
Esfand S

App Engine Fan: Are You The Key Master ? - 0 views

  • I figure it is going to take me at least four iterations to get this right. The first one will be building a GWT application with a simple UI that has no server logic behind it (just to learn how layout in GWT works). Step two will be adding a fake servlet backend (not app engine, just in memory). While not exactly App Engine yet, I should have a completely specified client-server API by the end of this process that I can subsequently implement on App Engine (iteration 3). Iteration four will handle deployment, CSS and whatever I may screw up in iterations one and two. I will log my notes of things I run into while I code.
  •  
    this is the para 1this is the second para
Esfand S

GWT fu, Part 1: Going places with Google Web Toolkit - 0 views

  • Summary:  Google Web Toolkit (GWT) lets you use the Java™ language to implement rich client user interfaces that run in a browser. In this two-part article, David Geary brings you up to speed on the latest version of GWT and shows you how to implement a desktop-like Web application.
  •  
    GWT is best suited for creating desktop-like applications that are replete with amenities such as drag-and-drop, windows and dialogs, and interactive widgets such as viewports. Although it's a simple application, the places application illustrates the potential for building such an application with GWT. So far I've shown you some fundamentals of GWT, including RPCs and database access, implementing composite widgets, event handling, and Ajax testing. In Part 2, you'll learn about some advanced GWT features, including sinking events, implementing GWT modules, and using event previews.
Esfand S

GWT, Blobstore, the new high performance image serving API, and cute dogs on ... - 0 views

  • Blobstore crash course It’ll be best if we gave a quick refresher course on the blobstore before we begin. Here’s the standard flow for a blobstore upload: Create a new blobstore session and generate an upload URL for a form to POST to. This is done using the createUploadUrl() method of BlobstoreService. Pass a callback URL to this method. This URL is where the user will be forwarded after the upload has completed. Present an upload form to the user. The action is the URL generated in step 1. Each URL must be unique: you cannot use the same URL for multiple sessions, as this will cause an error. After the URL has uploaded the file, the user is forwarded to the callback URL in your App Engine application specified in step 1. The key of the uploaded blob, a String blob key, is passed as an URL parameter. Save this URL and pass the user to their final destination
1 - 20 Next › Last »
Showing 20 items per page