Archive for August, 2008

Ext GWT: Now with Portal and Web Desktop

Tuesday, August 26th, 2008

Ext GWT 1.1 is right around the corner and incorporates the popular Portal and Web Desktop interface.

WebDesktop

The desktop mimics the behavior of the operating system look at feel. It is now possible to create multi-window applications with support for a task bar and start menu. Windows support normal, maximize, and minimize states. The start menu is a custom menu that allows new menu items. In addition, there is support for a “task” area for adding additional items.

Portals

Portal is a custom layout container that uses a multi-column layout on contains Portlets. Each Portlet can be drag and dropped to change order or move to another column. Each Portlet can contain any content and supports icons to expand / collapse, close, etc.

It could not be much easier to create content for a Portal:

    // create a portal
    Portal portal = new Portal(3);
    portal.setBorders(true);
    portal.setStyleAttribute("backgroundColor", "white");
 
    // set colum widts as pixels or percentages
    portal.setColumnWidth(0, .33);
    portal.setColumnWidth(1, .33);
    portal.setColumnWidth(2, .33);
 
    // create and add a potal to a column
    Portlet portlet = new Portlet();
    portlet.setHeading("Grid in a Portlet");
    portlet.setCollapsible(true);
    portal.add(portlet, 0);

Preview Now Available

There have been many new additions to the 1.1 release including all items from our Roadmap:

Anyone interested in a sneak peak can download the build here. 1.1 final will be released soon and work has already begun on 1.2. Drag and drop is the first item on the agenda for 1.2

Implementation Spotlight: Marketo

Monday, August 18th, 2008

We first heard about Marketo a long time ago, as they were a very early adopter of the Ext framework. The initial version of their marketing automation application was very nice even using pre-1.0 versions of Ext, and it has steadily improved over time. In addition to using the standard Ext components extensively, Marketo also employs their own custom UI theme to give the application a polished and distinctive look. They have also extended the base Ext platform with many sophisticated user interaction techniques that add power and expressiveness to the user experience.

I recently spoke with Glen Lipka, Marketo’s Director of UX and Product Management, and Paul Abrams, lead UI engineer, about their application and their use of Ext.

Tell us a little bit about Marketo and how you’re using Ext.

Marketo is sophisticated yet easy marketing automation that helps B2B marketing professionals drive revenue and improve accountability. In short, we are a Marketing department’s one-stop, on-demand resource. We use Ext as the fundamental base for the client-side interface. Additionally, I use the numerous examples posted on extjs.com and the forums as my UI design toolkit. When faced with a feature or problem, I often look at different UI examples. The samples on Ext give me confidence that we could implement that approach quickly without reinventing the wheel.

Marketo Screenshot

Did you evaluate other JavaScript frameworks when starting work on Marketo? Why did you choose Ext?

We started using Ext very early, when it was called YUI-Ext. We were using YUI and Prototype and homegrown and others at the time. The mishmash wasn’t helping us, rather it was making maintenance difficult. When we started using YUI-Ext 0.33, there were lots of hurdles, but it still made things much better. We understood the vision and bought in. We skipped 1.0 and introduced 2.0 when it came out in Beta. By this I mean that we ran 0.33 and 2.0 simultaneously. The new efforts in 2.0 totally transformed our development process. The flexibility of the system and the general intuitive nature of how it was built made it an easy choice to standardize on.

How does Ext fit into your overall technical architecture?

We have a LAMPhp stack using the Symfony framework. Before Ext, we used a lot of one-off HTML. The CSS and HTML burden of trying to maintain duplicate code everywhere was a hassle. Now, we use Ext configurations and subclass components we want to extend. The potential of UI variations has dropped significantly and we can now reuse UI patterns much more effectively.

How has the transition from .33 to 2.0 been going?

We introduced 2.0 in the fall of 2007 and ran it with 0.33 and our legacy code. The new tree, grid and other components were much more in line with our needs. There were many useful enhancements in 2.0.

We are finally ready to remove the legacy 0.33 code. We hoped the technical switch would involve upgrading components to their Ext 2.x equivalent and be relatively painless. It took six months on and off experimenting with different strategies before finding a new app structure and upgrade approach that worked, and then a couple of months of solid work rebuilding all the components derived from YUI and YUI-Ext 0.33 from scratch in Ext 2.x. Unfortunately, little was reusable. We have delayed a few components while we are designing a new skin, and later this year we will have a 100% Ext 2.x application. This has been a long time coming, but we are excited about it.

The Marketo application is extremely feature-rich. How did you manage the UI code complexity?

Just like Ext, we organize our code base into components and try to reuse as much code as possible. For example, our main Viewport lives in a folder/namespace and gets its own .js and .css files. We also have custom extensions for most of the major building blocks such as trees, combo boxes, grids, dialogs, etc.

Marketo Grid

What features could we add to Ext to make building a rich application like Marketo easier in the future?

There have been several places where building a custom extension involved overriding private methods, so more subclass hooks and smaller methods would help.

Ext also needs a unified Ajax session manager similar to the role of the Ext window manager. A rich web application like Marketo needs more management over the user session, such as detecting a session timeout and showing a login prompt. Another example is managing groups of Ajax requests, so that making a request to the same group could abort ongoing requests. Building an Ext RIA would involve creating a Viewport and an Ajax session manager, and then building components on top of that foundation. We rolled our own session manager in the 0.33 days and need to hook in the new Ext 2.x components.

Do you have any advice for developers just starting out with Ext for the first time?

If you are building a large application, don’t try to use Ext to decorate an existing app via “unobtrusive JavaScript” or build an app half with conventional construction and half with Ext. Instead, embrace Ext as a framework and start from scratch with something like a Viewport, and build components on top of that foundation.

Ext 2.2 Released

Monday, August 4th, 2008

We are pleased to announce the release of Ext 2.2, a fully backwards-compatible maintenance release of Ext. This is a recommended upgrade for all Ext 2.x users as it not only adds many new components and examples, but also provides a host of important bug fixes and performance improvements.

New Features

While many minor release versions are simply boring bug fix releases, we have also decided to pack a bunch of brand new components and extensions into 2.2 for your enjoyment. Let’s start off with the fun stuff!

CheckboxGroup / RadioGroup

CheckboxGroup and RadioGroup
Technically, while the individual Checkbox and Radio controls are not new, they may as well be, considering the overhaul they have had in this release. Gone are the ugly standard browser input controls, now replaced by attractive, visually-consistent Ext-ified versions (a long-overdue improvement).

In addition to that, we’ve added group controls for both that support complex layouts with just a config option or two. This was inspired, in part, by the RadioGroup user extension created by community member vtswingkid. Previously in order to accomplish similar grouping layouts for checkbox/radio controls you would have had to create a container with a ColumnLayout and manually place your controls across multiple column configs. Now you can do something as simple as…

	... },{
	    xtype: 'checkboxgroup',
	    fieldLabel: 'Multi-Column (horizontal)',
	    columns: 3,
	    items: [
	        {boxLabel: 'Item 1', name: 'cb-horiz-1'},
	        {boxLabel: 'Item 2', name: 'cb-horiz-2', checked: true},
	        {boxLabel: 'Item 3', name: 'cb-horiz-3'},
	        {boxLabel: 'Item 4', name: 'cb-horiz-4'},
	        {boxLabel: 'Item 5', name: 'cb-horiz-5'}
	    ]
	},{ ...

Check out the live example.

History

History
Another component that has been missing in Ext is a browser history utility to enable history stack navigation within your single-page Ext application. The new Ext.History singleton makes it extremely easy to do exactly that, and it uses an event-based API to notify you when the browser history has changed. Check out the live example.

MultiSelect / ItemSelector

MultiSelect
These two components were contributed to Ext by community member TJ Stuart (thanks TJ). The MultiSelect is a traditional list control that allows for selecting multiple list items, and the ItemSelector combines two MultiSelects into a more sophisticated control that includes drag-and-drop list selection and bulk selection and deselection among other features. Check out the live example.

For the time being these controls are still implemented as user extensions, and the MultiSelect will likely be migrated to become a core component in a future release. They should not yet be considered to be API-stable controls, but should still be quite useful if you need the functionality.

FileUploadField

FileUploadField
This is an official extension provided as a sample for implementing a useful form component. Not everyone needs a form upload component, but if you do, you can’t live without it. This control is fully styled and has an API consistent with other Ext form controls. It also supports both Text+Button (read-only text) and Button-only modes, and can participate fully in form layouts. Check out the live example.

XmlTreeLoader

XmlTreeLoader
This official extension provides a great demonstration of extending an existing Ext component to provide functionality that you need in your own application. Again, loading an XML document into a tree is not needed by everyone, but if you do need something similar, this should be a great demo. Check out the live example.

GMapPanel

GMapPanel
This extension was originally written up as a demo for one of our previous blog posts. However, it proved to be such a hit with the community that we transformed it into an official extension. This is another useful example of extending a standard Ext component, in this case to interface with an external API. Check out the live example.

Other Notable Changes

“But wait, isn’t this a maintenance relase?”

It sure is, and there have been countless fixes and improvements in the framework since 2.1. Here are some of the most important highlights from what’s changed.

Full Firefox 3 Support

History
Firefox 3 is a fantastic upgrade from version 2 (especially on Mac — I’m looking at you, scrollbars!). Ext performance out of the box on Firefox 3 is far better than it was before. However, the negative is that the new version also introduced a handful of bugs that have been addressed in this Ext release. Most notably:

  • Grid columns were visually misaligned
  • Ext.onReady stopped working reliably (our desktop demo stopped initializing correctly)
  • The DatePicker width ran off the screen, making the control unusable
  • The TabPanel contextmenu event stopped firing, killing the TabCloseMenu extension
  • Window dragging stopped working correctly
  • Various minor visual inconsistencies

If any of these issues sounds familiar, then Ext 2.2 is for you!

Advanced Drag and Drop Examples

Drag and Drop
There are 3 new advanced drag-and-drop examples available in the Ext distribution, authored by community members Animal and JGarcia (thanks guys). These examples demonstrate:

  • How to implement the Ext.DragZone/DropZone classes in the context of a business-style application (live demo)
  • Dragging and dropping records from one grid to another (live demo)
  • Dragging records from a grid and dropping them onto a form to populate the form’s fields (live demo)

Performance Improvements, Bug Fixes and Other Goodies

  • New properties for differentiating Firefox version (Ext.isGecko2 and Ext.isGecko3)
  • New support for deferred row rendering in the grid (the default), boosting render performance significantly
  • Refactor of EventManager to improve how event handlers are managed, which should help alleviate IE DOM leaks
  • Fixed the “small PNG’s can cause performance issues in IE7″ problem
  • More than 100 additional fixes and improvements

Consult the 2.2 release notes to get a complete listing of all changes.

We are very happy with this release and hope that it will provide a lot of value to our community. And for all of you version 1.x users, we have not forgotten about you either. We plan to push out Ext 1.2 within the next few days to address many of the same bugs mentioned above, including Firefox 3 issues, so keep an eye out for that.

Download Ext 2.2