Gaia Ajax 4.0 is in the nightly!

by Stian Solberg 18. June 2013 11:03

Gaia Ajax 4.0We have been spending a lot of time the last months wrapping up what will be the upcoming 4.0-release.

It is easy to grab the latest bits:

To get a summary of what has changed, take a look at front page of nightly samples.

We'd love to get your feedback, please use the forum.

Kind regards
The Gaiaware team

 

 

Gaia Ajax 3.7 Release Notes

by Jan Blomquist 15. June 2011 01:06
Gaia Ajax 3.7 release notes ...

It's a great pleasure to announce the availability of Gaia Ajax 3.7. A premier GUI library for ASP.NET 2.0, 3.5 & 4.0 with sophisticated built-in ajax support. At it's foundation is the embracing of the ASP.NET programming model with server controls, events and the .NET programming model.

Instead of claiming that it's the finest ajax library for ASP.NET, perhaps you should give it a spin yourself

Why should I upgrade to Gaia 3.7?

  •  Visual Studio 2010: We now fully support VS.NET 2005, 2008 and 2010!
  •  Ajax: All controls now fully utilize the advanced ajax engine
  •  Features: Lots of new and exciting features in controls and aspects
  •  Samples: New samples available - experience the highlights at the online samples

How does Gaia Ajax assist with Web Development in ASP.NET?

  • 40+ ajax server controls (window, treeview, tabcontrol, etc)
  • 10+ aspects to add behaviours (drag&drop, modality, resizable) to all controls.
  • 20+ effects to easily add animations to all controls
  • Build the entire Web App fully in your favorite .NET language
  • Browsers: IE6,7,8,9, FireFox, Safari, Opera, Chrome, ...
  • Source code included
  • Royalty-free

Did you know that?

  • Gaia Ajax is enjoyed by millions of end users all around the world
  • Gaia Ajax 1.0 was first released 5th of February 2007.
  • Gaiaware is the name of the company behind Gaia Ajax
  • Gaiaware's chairman, Eirik Chambe-Eng, was one of the two founders of QT

What are you waiting for ...

Click here to see the full changelog for Gaia Ajax 3.7

GWF beta released! (w/full source) - a unique approach to web application development

by Jan Blomquist 28. December 2010 17:25

GWF was created for the following reasons

  1. To simplify web application development with built-in support for many of the tasks we do over and over again
  2. To serve as a more complete example of what can be accomplished with Gaia Ajax - the best ajax library for ASP.NET!
  3. To illustrate the powerful DRIMR technology with a concrete example of it's benefits

GWF had the following design goals in mind

  1. Document based storage approach (JSON)
  2. Drag&Drop page composition with instant loading
  3. Use Convention over Configuration
  4. Dynamic Discovery of resources and definitions
  5. Simple and convenient API for developers
  6. Easy to extend
  7. Also licensed under GPL

Click here to download gwf-beta1-src.zip (VS.NET 2010 SLN)

The GWF package also includes

  1. Gaia Server Control Wrapper for TinyMCE rich-text-editor
  2. Gaia EntityView controls w/validation support

GWF is not

  1. A fully fledged CMS (yet!) or AMS for that matter
  2. Fully documented
  3. Fully tested

Use GWF if you want

  1. To get some useful bits of code for your web application
  2. To be inspired by the no-javascript approach of Gaia Ajax
  3. A convenient ajax based page navigation with full browser history support
  4. A modular approach to your web applications
  5. A code-less, create more strategy
  6. To create a nice KPI dashboard solution with content reuse via DRIMR
  7. To create an AJAX based wizard
  8. A dynamic UserControl loading framework
  9. More of your dreams to come true :-)

Click here to download gwf-beta1-src.zip (VS.NET 2010 SLN)

Now let's discuss some of the goodies in GWF:

GWF uses a document-based approach to define Pages. As you can see there's a one-to-one mapping between the navigation in GWF and the document folder structure on the disk. Also each page in GWF is called a VirtualPage because modules can be dynamically added, removed and reused between page navigations. Yes -You read me right! The powerful DRIMR technology in Gaia Ajax is able to dynamically insert and remove modules and also reuse data based on the coordinate system.

VirtualPage composition is fully WYSIWYG, but you can also just edit/xcopy the files directly if you need to modify each page (VirtualPage). An example of such a document can be seen in the screenshot below.

 

If you have missed a RichTextEditor in Gaia Ajax you can use the editor provided in GWF which is a wrapper around TinyMCE

Creating "Modules" in GWF is as simple as just creating a UserControl (no inheritance requirements imposed on you). In the screenshot below you can see the YouTube module created in ~30 lines of code. When VideoUrl is tagged as ModuleSetting, an editor in Edit mode is automatically provided for you. Also this value is persisted automatically in the document based file automatically.

 

Another nice treat is that "new" modules are automatically discovered and will appear in the AvailableModules list. That means zero configuration!

By now you probably wonder how things are composed. Let's walk through the rules / functional stuff

  1. You can create a hierarchy of VirtualPages and use ajax page based navigation between them
  2. Each VirtualPage requires a Layout which is basically the container controls where Modules can be dropped and configured
  3. Each Module can have a Container which is the chrome around it. The Container can be turned off, but will always be visible in edit mode to enable the editors
  4. Each Module can opt-in for loading and saving of ModuleSettings.
  5. Each Module can opt-in for additional EditorCommands. (see RichTextEditor / ISupportCommands)
  6. Use GwfManager.Instance.VirtualRedirect(string) to perform virtual page redirects (tip: check Firebug response :-) )
  7. Use the building blocks to define your own desired behavior. The Website/default.aspx is just an example to demonstrate some of the capabilities in GWF

Click here to want a small YouTube video demonstrating GWF

GWF has been used successfully in a few customer projects. Feel free to take it for a spin yourself! Contributions/Forks are welcome.

 

 

Gaia Ajax 3.7 *beta*

by Jan Blomquist 22. November 2010 15:13

Highlights

  • VS.NET 2010 Support (Improved Design Time Experience)
  • DRIMR enhancements (All extensions now utilize DRIMR)
  • Compatibility with ASP.NET and 3rd party control libraries

Links

Gaia Ajax 3.7 beta is a solid product that probably could have been labeled a release. It's currently deployed to multiple large scale production applications and is running smooth and fast. We do however strongly believe in getting some bits out for public consumption before we do the final mark and make it an official release.

Since we believe so strongly in open standards we have continued to evolve and innovate on top of the ASP.NET platform. Gaia Ajax 3.7 is yet another proof that Gaiaware is committed to you as a long term partner that you can put some trust in. Also due to the nature of our dual license policy and inclusion of source code you are guaranteed the ability to modify and extend the product.

GWF - Gaia Web Framework Video Demo

If you want to learn more about the possibilties with Gaia Ajax -we recommend you watch the following video demonstrating the GWF framework which we will ship with the final version of Gaia Ajax 3.7. It nicely demonstrates the power of Gaia Ajax as the best toolset for building powerful web applications on top of ASP.NET.

Where to from here

The 3.7 beta download only contains the dlls -so we are considering various installation frameworks to create a good install experience before we go live with the 3.7 release. We will fix reported issues asap and make them available via our build servers. If you want to go in production with the 3.7 beta simply just buy the 3.6 version which entitles you to use the 3.7 bits. Smile

Tags: , , ,

Ajax | Gaia | Mono

MVC on ASP.NET without ASP.NET MVC

by Jan Blomquist 10. February 2010 09:54

Background

MVC (Model View Controller) is an architectural pattern and in many ways the preferred approach for layering your application. ASP.NET MVC is Microsoft's solution to a set of common challenges that face web developers today. Some of these problems are: -

ASP.NET MVC "forces" the developer to model their application according to their MVC architecture and brings greater control and granularity over markup. Because of this, ASP.NET Ajax (or jQuery for that matter) becomes easier to use since you no longer need to deal with for example autogenerated IDs (ie: ctl101_panelContainer_GridView1) which can be hard to use in client-side ajax applications.

Throwing the baby out with the bath water

Another alleged "benefit" of ASP.NET MVC is that the WebForms model is thrown out, so concepts like ViewState, Postbacks and fully templated event driven server controls doesn't exist anymore. This can be a good thing for an html/css/javascript ninja who wants the pedal to the metal and don't like too many abstractions, however I would argue that MVC on top of the WebForms model is far more superior and in this blog we are going to outline the structure of such an application.

An example of a successful ASP.NET MVC implementation today is StackOverflow -one of the most frequently visited websites for professional developers online today. The development of this project is a small group of developers (3?) who work day to day on the project and have deep intrinsic knowledge of it's inner workings. 

ASP.NET MVC might be the right choice for you depending on your requirements, but creating ANY ASP.NET application today without utilizing some form of MVC seems outrageous IMHO. I would put forth the following postulate derived from this claim:

A well designed ASP.NET WebForms application is an MVC application

Let's take a closer look at how you would assemble such an MVC application using the WebForms model. Don't forget the following regarding design patterns: "A a design pattern is not a finished design that can be transformed directly into code. It is a description or template for how to solve a problem that can be used in many different situations" - Wikipedia

MVC without ASP.NET MVC

We've created a small application that utilizes the MVC pattern on top of the WebForms model today. Currently it's published at one of our build servers.

When you open the sample you can click the (Click here to get the details]) button to expand various code listings and some code explainations. Let's walk through the application structure together. It's a simple list of Tasks that can be filtered by date and contact person. Since the whole idea is to separate the business code/logic from each UI/View I've created a few models and multiple views. The model is basically just a contract (interface) which defines the operations which the controller needs in order to function. Each View must implement the contract so the controller can do it's work. You have full freedom to architect your models as you find suitable and I would recommend you to favor composition over inheritance .


Models

Here's the code for the IActivityModel

Codebehind (C#/.cs)

   1:  namespace Gaia.WebWidgets.Samples.Combinations.WebApps.MVC.Models
   2:  {
   3:      /// <summary>
   4:      /// This is the model that "glues" together the filter and results and is the
   5:      /// main input to the Controller which then works against this model
   6:      /// </summary>
   7:      public interface IActivityModel
   8:      {
   9:          IActivityFilter Filter { get;}
  10:          IActivityList ViewResults { get;} 
  11:      }
  12:  }

 In order to reuse the Filter I've created it as a separate model. Then I went ahead and created a model which will be used to viewed the results based on the filter. This is the IActivityList model which can be seen here:

Codebehind (C#/.cs)

   1:  namespace Gaia.WebWidgets.Samples.Combinations.WebApps.MVC.Models
   2:  {
   3:      using System.Collections.Generic;
   4:      using Utilities;
   5:   
   6:      /// <summary>
   7:      /// Model that allows binding of results to a View
   8:      /// </summary>
   9:      public interface IActivityList
  10:      {
  11:          void View(IEnumerable<CalendarItem> data);
  12:      }
  13:  }

As you can see, the only operation currently needed is the View method which takes an IEnumerable in order to bind the data. By using such a low common denominator, we can bind to almost anything for presentation, even a custom scheduler component if one were to require such functionality.

Views

The sample has defined 3 views (Repeater, GridView and Listbox) + 1 Mock View used in UnitTests. The codebehind file for the GridView View can be seen here:

Codebehind (C#/.cs)

   1:  namespace Gaia.WebWidgets.Samples.Combinations.WebApps.MVC.Views
   2:  {
   3:      using System.Web.UI;
   4:      using System.Collections.Generic;
   5:      using Models;
   6:      using Utilities;
   7:   
   8:      public partial class ActivityListGridView : UserControl, IActivityList
   9:      {
  10:          void IActivityList.View(IEnumerable<CalendarItem> data)
  11:          {
  12:              zGrid.DataSource = data;
  13:              zGrid.DataBind();
  14:          }
  15:   
  16:      }
  17:  }

In this case we created a UserControl, but it could also have been a server control or an arbitrary class also. It just doesn't matter when modelling after the MVC pattern.

Some have argued that you loose control over markup with the WebForms model and that is true when using powerful components like (GridView, Scheduler, Window, TabControl, etc), but it doesn't have to. Here's a code excerpt from the RepeaterView and as you can see this will give you full control over rendered markup:

Markup (ASPX/.aspx)

   1:  <%@ Control 
   2:      Language="C#" 
   3:      AutoEventWireup="true" 
   4:      CodeBehind="ActivityListRepeater.ascx.cs" 
   5:      Inherits="Gaia.WebWidgets.Samples.Combinations.WebApps.MVC.Views.ActivityListRepeater" %>
   6:   
   7:  <gaia:Panel ID="w" runat="server">
   8:      <ul style="border: 1px solid #999; margin: 5px 5px 5px 0px;">
   9:          <asp:Repeater ID="zView" runat="server">
  10:              <ItemTemplate>           
  11:                     <gaia:Label ID="f" runat="server"><li></gaia:Label>
  12:                     <gaia:Label ID="dt" runat="server" Text='<%# Eval("ActivityDate", "{0:ddd dd. MMM}")%>' />
  13:                     <gaia:Label ID="p" Font-Bold="true" runat="server" Text=' <%# Eval("ContactPerson")%>' />
  14:                     <gaia:Label ID="t" ForeColor="red" runat="server" Text='<%# Eval("ActivityName")%>' />
  15:                     <gaia:Label ID="l" runat="server" /></li>
  16:              </ItemTemplate>
  17:          </asp:Repeater>
  18:      </ul>
  19:  </gaia:Panel>

And really? Are abstractions like Window, Scheduler, Grid bad? I would'n want to develop without my reusable server controls!

The C in MVC - Controllers

Ok - we have defined the model and seen the code for some views. Let's examine the Controller and see how that works.

Codebehind (C#/.cs)

   1:  namespace Gaia.WebWidgets.Samples.Combinations.WebApps.MVC.Controllers
   2:  {
   3:      using System;
   4:      using System.Collections.Generic;
   5:      using Utilities;
   6:      using Data;
   7:      using Models;
   8:   
   9:      /// <summary>
  10:      /// This is the Controller in the MVC pattern and it acts as the "hub" and is responsible for
  11:      /// working on the models and implementing business rules, DAL communication, etc
  12:      /// </summary>
  13:      public class ActivityController : ControllerBase
  14:      {
  15:          private readonly IActivityModel _activityModel;
  16:   
  17:          public ActivityController(IActivityModel activityModel)
  18:          {
  19:              _activityModel = activityModel;
  20:          }
  21:   
  22:          public override void Initialize()
  23:          {
  24:              _activityModel.Filter.BindPersons(ActivityDataLayer.GetContacts());
  25:              _activityModel.Filter.When = DateTime.Now.Date;
  26:   
  27:              ViewChanged();
  28:          }
  29:   
  30:          IEnumerable<CalendarItem> GetItems()
  31:          {
  32:              return ActivityDataLayer.GetByDateAndPerson(_activityModel.Filter.When, _activityModel.Filter.SelectedPerson);
  33:          }
  34:   
  35:          public override void ViewChanged()
  36:          {
  37:              _activityModel.ViewResults.View(GetItems());
  38:          }
  39:    
  40:      }
  41:  }

Another model From the code you can see that we take a model as input parameter to the constructor. This model will be the View itself. In the initialize method we set default values for the DateTime filter and populate the list of available ContactPersons from which the UI can select a person. The IActivityFilter also denotes the SelectedPerson so we should have sufficient information to perform a Filter operation and retrieve data.

Notice the call to the View method on the model where the data is passed in. This takes place in the ViewChanged() operation which can be invoked from the UI too. For example in the SelectedIndexChanged event of the dropdownlist. Ok, so now you have seen the three layers in the MVC architecture. The benefits we have seen so far is

  • Disconnected UI from business logic.
  • UI/Client could easily have been something else (Mobile, WinForms, etc)
  • Removed code from the UI where it might introduce "spaghetti code"
  • Stricter adherence to contract lessens error likeliness

Unit Testing

Ok, but how would you go about and test this stuff? We could have tested this in multiple ways, but the easiest is probably to create mock objects that represent the Views and then pass these MockModels as input parameters to the Controller. Here's a few "dummy" examples of some unit tests. I've just faked the unit test framework and you can swap this out with your favorite unit testing framework. 

Codebehind (C#/.cs)

   1:  namespace Gaia.WebWidgets.Samples.Combinations.WebApps.MVC.Tests
   2:  {
   3:      using System;
   4:      using Controllers;
   5:      using Data;
   6:   
   7:      /// <summary>
   8:      /// This is just a "dummy" test-suite to demonstrate that it's easy to write
   9:      /// TDD - Test Driven Development against an MVC application
  10:      /// </summary>
  11:      public class ActivityTests
  12:      {
  13:          public void Test_ActivityController_TestInitialize()
  14:          {
  15:              ActivityModelMock mock = new ActivityModelMock();
  16:              new ActivityController(mock).Initialize();
  17:   
  18:              bool dateInitialized = mock.Filter.When == DateTime.Now.Date;
  19:              DummyAssert.IsTrue(dateInitialized);
  20:          }
  21:   
  22:          public void Test_ActivityController_TestFilter()
  23:          {
  24:              ActivityModelMock mock = new ActivityModelMock();
  25:              new ActivityController(mock).Initialize();
  26:   
  27:              ActivityListMock view = mock.ViewResults as ActivityListMock;
  28:   
  29:              bool sameData = ActivityDataLayer.GetByDateAndPerson(
  30:                  mock.Filter.When, mock.Filter.SelectedPerson).Count== view.CalendarItems.Count;
  31:              DummyAssert.IsTrue(sameData, "Different data based on same filter");
  32:          }
  33:   
  34:          public void Test_ActivityController_TestMockObject()
  35:          {
  36:              ActivityModelMock mock = new ActivityModelMock();
  37:              new ActivityController(mock).Initialize();
  38:   
  39:              ActivityListMock view = mock.ViewResults as ActivityListMock;
  40:              DummyAssert.IsTrue(view != null, "Unable to get test implementation");
  41:          }
  42:   
  43:      }
  44:  }

Suddenly we've created a robust architecture based on the principles of MVC. Also we've taken advantage of all the good things that come for free in Gaia Ajax and we've built on top of the powerful WebForms model on ASP.NET. And we've made our code highly testable and reusable.

Routing / Dynamic Loading

What more could there be? Well, since you're asking we could have implemented dynamic loading of views (routing?) based on some scheme (url, page, configuration, etc) and in fact this sample automatically loads the available Views dynamically and populates the DropDownList with all the Views that implement the model that we are looking for. This functionality is implemented on the page level and allows you to switch out UI/View on-the-fly. Just click here and  try it out for yourself.

Other ASP.NET MVC drawbacks

An author behind one of the ASP.NET MVC books (Jeff Putz) points out some of the ASP.NET MVC drawbacks on his blog

  1. It also lacks the kind of UX encapsulation that we get with Webforms. For example, I have a template based image gallery control that I've used time and time again. The markup that appears in each cell of the table can be anything I want, and I can tell it to leave a "hole" for a template containing an advertisement. All I do is drop it on a Webform and fill in the templates and it automagically works. This kind of reuse isn't in the strictest sense possible in MVC if you're adhering to the design pattern.
  2. The magic of having a simulated stateful form is also gone, with no postback mechanism. The entire event model is thrown out.
  3. Views feel a little like spaghetti code from old ASP (the scripting platform that used the tragic VBscript)
  4. And the biggest concern I have is that developers won't be thinking about security the way they should. It's already possible in Webforms (or any other platform) to put together an HTTP request with the right information to simulate a legitimate user action and do naughty things when the right preventative code is not in place, but it's even easier in MVC. A URL like "/cats/kill/42" is probably intended to execute cat.Lives-- and it's easy to guess. A lot more care has to be taken to validate data and enforce security.

At the moment I don't see any reason to abandon the WebForms model in favor of ASP.NET MVC, generally because we've had MVC for a long time already, but more specifically for the reasons outlined above and in particular because of simulated Windows Forms development experience brought by the WebForms model. I can respect that many developers don't see this from my point of view if they are using jquery/asp.net ajax and similar client-side technologies. The MVC architecture on top of the WebForms model becomes truly aparent with the right tooling and proper abstractions -like Gaia Ajax. The same would go for related techologies like (Google Web Toolkit)

Conclusion

The following quote from Jeff Atwoods blog pretty much summarizes my feelings about the ASP.NET MVC stuff:

"As we work with ASP.NET MVC on Stack Overflow, I find myself violently thrust back into the bad old days of tag soup that I remember from my tenure as a classic ASP developer in the late 90's. If you're not careful bordering on manically fastidious in constructing your Views, you'll end up with a giant mish-mash of HTML, Javascript, and server-side code. Classic tag soup; difficult to read, difficult to maintain."

If you want to comment on the blog, please use our forums at forum.gaiaware.net

Async loading with Non-blocking UI in ASP.NET with Gaia Ajax

by Jan Blomquist 18. January 2010 14:40

 

We've just published a new sample that demonstrates how to create a web page that loads items as they become available and doesn't block the UI. That means you can fully use the Web Application while another thread is spinning on the server doing the hard work.

Click here to view the sample from our nightly published samples application:
http://nightlysamples.gaiaware.net/Combinations/WebUtilities/AsyncLoading/

Or you can pickup a nightly drop here:
http://build.gaiaware.net/Trial/

The idea behind this is not new, but Gaia Ajax makes this so simple to implement and so fast thanks to the automatic diff/merge capabilities of the DRIMR technology which was introduced in Gaia Ajax 3.6. Click here to view a view about Gaia Ajax DRIMR
Sometimes Web Applications are dropped in favor of traditional Desktop applications because of performance requirements. It's not viable to create web applications that requires long time before responding. However, many functions still require lots of processsing before they can return data at all. The ideal way to solve this is the following

  1. Serve up the UI instantly.
  2. Allow the user to start the time consuming task
  3. Deliver the data for consumption in the UI as it becomes available -leaving the application operational. 

Creating the UI for this kind of application is hard enough as it requires you to dig into multi-threading and it's many pitfalls. Creating the UI as a Web Application becomes almost unthinkable as it adds yet another layer of complexity that makes the project run the risk of blowing up. That being said, any sane person reverts to the good old locally installed application with it's drawbacks to solve the problem.

Does it really have to be like that? I will argue in this blog that it's just as easy -or easier? to create a scalable, robust, multi-threaded web application in ASP.NET that doesn't block the UI -than to revert to writing desktop applications.

The reason is partially because ASP.NET is multi-threaded in itself. Each web request is tied to a Worker thread that lives throughout the duration of that page lifecycle. The process of running the lifecycle and generating the control tree is very in-expensive. In Gaia Ajax, the lifecycle running time is even chopped an additional 30%. Almost always the most expensive operation is your I/O threads. These threads often deal with files, databases, webservices and anything else which is not (in-process). I/O is so dramatically more expensive (realtive to worker threads) that Microsoft introduced the Async pattern in ASP.NET 2.0

"The problem with the ASYNC pattern is still that no WebPage is being delivered before all I/O threads are finished with their work". I argue that another option is to serve the WebPage with few or no I/O threads at all. The delivery time of the web application becomes instant.

Does that make any sense?
These I/O calls where there for a reason wheren't they? -Yes, and I am not saying that they are not going to be executed. I am simply saying that you can deliver the results over ajax by using a diff/merge strategy. In Gaia Ajax 3.6 you get automatic diff/merge for free! :-) Also the A in Ajax stands for asynchronous so they don't block the UI either.

But isn't multithreading Evil?
Yes it's evil and if you can avoid it -so you should. However, in .NET we've gotten lots of tools, code, patterns and various ways of dealing with the issue of concurrency. Modern CPU's are not scaling in terms of higher clock speed, but more cores (Link to Intel 48 cores). The LINQ to Parallells project  is now going shipped as part of .NET Framework 4.0. Instead of being afraid of the beast, I think it's time we deal with it and create the next generation of modern web applications utilizing all these cores available to us.

Ok, so how does this relate to Gaia Ajax?
Gaia makes this paradigm easy to implement with no javascript, no bloat and only the state changes are merged down to the client. Also Gaia implements an ajax request queue which only dispatches 1 ajax request at a time allowing for no concurrency issues there. You still have to deal with concurrency, race conditions, etc in your web application, but like I said that's a lot easier with all the stuff that's available to us there.

The following code snippets outline how this simple example was written. It contains 1 aspx file with a button, datagrid and timer and in the codebehind we toggle enabled and visibility properties and kick off the work which goes on in the BackgroundWorkerTask.cs file. The sample was written to be minimalistic and simple and serves more as a proof-of-concept than production ready code. The code is available in the sample too, but I'll paste it in here for your convenience.

Markup (ASPX/.aspx)

   1:   
   2:  <gaia:Button 
   3:      ID="zButton" 
   4:      runat="server" 
   5:      Text="Start Async Operation" 
   6:      OnClick="zButton_Click" />
   7:      
   8:  <gaia:Image 
   9:      ID="zImageLoader" 
  10:      ImageUrl="ajax-loader.gif" 
  11:      runat="server" 
  12:      Visible="false" />
  13:      
  14:  <gaia:GridView 
  15:      runat="server" 
  16:      ID="zGrid" 
  17:      Width="100%"
  18:      AutoGenerateColumns="false"
  19:      CssClass="async-grid">
  20:          <RowStyle CssClass="itemEven" />
  21:          <AlternatingRowStyle CssClass="itemOdd" />
  22:          <Columns>
  23:              <gaia:BoundField 
  24:                  HeaderText="Time" 
  25:                  DataField="ActivityDate" 
  26:                  DataFormatString="{0:HH:mm}" />
  27:              
  28:              <gaia:BoundField 
  29:                  HeaderText="Name" 
  30:                  ItemStyle-Width="50%"
  31:                  DataField="ActivityName" />
  32:              
  33:              <gaia:BoundField 
  34:                  HeaderText="Contact" 
  35:                  ItemStyle-Width="25%"
  36:                  DataField="ContactPerson" />
  37:          Columns>
  38:  gaia:GridView>
  39:   
  40:  <gaia:Timer 
  41:      ID="zTimer" 
  42:      runat="server" 
  43:      Milliseconds="1000"
  44:      OnTick="zTimer_Tick" 
  45:      Enabled="false" >
  46:  gaia:Timer>
  47:   
  48:   

Codebehind (C#/.cs)

   1:  namespace Gaia.WebWidgets.Samples.Combinations.WebUtilities.AsyncLoading
   2:  {
   3:      using System;
   4:      using UI;
   5:      using Utilities;
   6:      using WebWidgets.Effects;
   7:   
   8:      public partial class Default : SamplePage
   9:      {
  10:          const string CollapsedText = "Click here for more details ...";
  11:          const string ExpandedText = "Click here to hide again";
  12:   
  13:          protected void Page_Init(object sender, EventArgs e)
  14:          {
  15:              SetTimerPollingBasedOnNetworkLatency();
  16:              zViewResponse.Text = CollapsedText;
  17:          }
  18:   
  19:          protected void Page_Load(object sender, EventArgs e)
  20:          {
  21:              if (!IsPostBack) BackgroundTask = null;
  22:          }
  23:   
  24:          protected void zButton_Click(object sender, EventArgs e)
  25:          {
  26:              if (BackgroundTask.IsRunning) return;
  27:              BackgroundTask.Data.Clear(); 
  28:              BackgroundTask.RunTask();
  29:              ActivateUiTaskRunning();
  30:              DataBindGridViewToProcessedItems();
  31:          }
  32:   
  33:          protected void zTimer_Tick(object sender, EventArgs e)
  34:          {
  35:              DataBindGridViewToProcessedItems();
  36:              if (!BackgroundTask.IsRunning) DeactiveUiTaskRunning();
  37:          }
  38:   
  39:          private void DataBindGridViewToProcessedItems()
  40:          {
  41:              zGrid.DataSource = BackgroundTask.Data;
  42:              zGrid.DataBind();
  43:          }
  44:   
  45:          private void SetTimerPollingBasedOnNetworkLatency()
  46:          {
  47:              zTimer.Milliseconds = WebUtility.IsLocalhost ? 500 : 1000;
  48:          }
  49:   
  50:          private void DeactiveUiTaskRunning()
  51:          {
  52:              zImageLoader.Visible = false;
  53:              zTimer.Enabled = false;
  54:              zButton.Enabled = true;
  55:          }
  56:   
  57:          private void ActivateUiTaskRunning()
  58:          {
  59:              zTimer.Enabled = true;
  60:              zButton.Enabled = false;
  61:              zImageLoader.Visible = true;
  62:          }
  63:   
  64:          private CustomBackgroundWorker BackgroundTask
  65:          {
  66:              get
  67:              {
  68:                  return Session["worker"] as CustomBackgroundWorker ??
  69:                      (Session["worker"] = new CustomBackgroundWorker()) 
  70:                      as CustomBackgroundWorker;
  71:              }
  72:              set { Session["worker"] = value; }
  73:          }
  74:   
  75:          protected void zViewResponse_Click(object sender, EventArgs e)
  76:          {
  77:              /* some effects for show-off */
  78:   
  79:              bool show = zViewResponse.Text == CollapsedText;
  80:              zViewResponse.Text = show ? ExpandedText : CollapsedText;
  81:   
  82:              if (show)
  83:                  zCodeResponse.Effects.Add(
  84:                      new EffectParallel(
  85:                          new EffectMorph("width: 650px; height: 450px;", 0.5M),
  86:                              new EffectAppear(0.5M)));
  87:              else
  88:                  zCodeResponse.Effects.Add(
  89:                      new EffectParallel(
  90:                          new EffectMorph("width: 0px; height: 0px;", 0.5M),
  91:                              new EffectFade(0.5M)));
  92:          }
  93:      }
  94:  }

Codebehind (C#/.cs)

   1:  namespace Gaia.WebWidgets.Samples.Combinations.WebUtilities.AsyncLoading
   2:  {
   3:      using System;
   4:      using System.Collections.Generic;
   5:      using System.Threading;
   6:      using Utilities;
   7:   
   8:      public class CustomBackgroundWorker
   9:      {
  10:          private bool _isRunning;
  11:          public bool IsRunning
  12:          {
  13:              get { return _isRunning; }
  14:          }
  15:   
  16:          public void RunTask()
  17:          {
  18:              lock (this)
  19:              {
  20:                  if (_isRunning)
  21:                      throw new InvalidOperationException("The task is already running!");
  22:   
  23:                  _isRunning = true;
  24:                  new Thread(DoWork).Start();
  25:              }
  26:          }
  27:   
  28:          private ICollection _data;
  29:          public ICollection Data
  30:          {
  31:              get { return _data ?? (_data = new List()); }
  32:          }
  33:   
  34:          void DoWork()
  35:          {
  36:              try
  37:              {
  38:                  for (int i = 0; i < 15; i++)
  39:                  {
  40:                      lock (Data)
  41:                          foreach (CalendarItem item in CalendarController.CreatItems(new Random().Next(1, 3)))
  42:                              Data.Add(item);
  43:   
  44:                      Thread.Sleep(new Random().Next(300, 2000)); // Random Sleep to simulate variance
  45:                  }
  46:              }
  47:              catch  { /* Task failed (suppress exceptions in demo) */ }
  48:              finally { _isRunning = false; }
  49:          }
  50:      }
  51:  }

Though simple in nature -the async sample demonstrates a truly powerful concept which could give your web applications a boost you'd never thought possible. So give it a spin and if you like it, please drop us a message by email or use our forums : http://nightlysamples.gaiaware.net/Combinations/WebUtilities/AsyncLoading/

 

Gaia Ajax 3.6 Final Release

by Jan Blomquist 24. November 2009 12:37

 

After some thousand hours of both eurekas and hard work, the "safe-to-put-in-production" bits of Gaia Ajax 3.6 is finally ready to be routed through your NIC and assembled on your harddrive. In this blog I will tell you the 3W+1H: Why, What, How & Where.

Why?

Ideally the product should speak for itself, but endow me a few bytes of your browser memory to unravel the architectural spirit behind the product. Gaia was built with the following ideas in mind:

  • Simplicity
  • Code reuse in a managed language of choice
  • Focus on highly reusable & versatile building blocks
  • It was designed to be your favorite toolbox which just works across all your web projects

"Philosophically speaking it's not so much about the controls that you find there, but more about the controls which you don't find".

This abstract idea can be a little difficult to comprehend at first, but you will become a better developer once you really get it. We humans find it hard to visualize on the non-existent, the history that never took place. A lot of one-size-fits-all components sometimes solves too much (often you need < 1%). Your job title quickly gets deduced to Professional Property Configurator and your products end up looking like everything else (we know! because we see it all the time) and where is the differentiator in that? Don't get me wrong -sometimes these are desireable means to an admirable goal, just don't forget the old gipsy curse: "May you get what you want and want what you get".

What do you get with Gaia Ajax 3.6?

3.6 contains an abundance of new "stuff". In reality, too much to cover here -so permittez-moi to show you what we believe are the most important updates for you.

DRIMR (Did you say D-R-I-M-R?)

DRIMR is an acronym for Dynamic Removals, Inserts, Moves and Replacements. DRIMR conceals all ajax complexity, shields the developer from exposure to low level details and is a common characteristic shared by all Gaia controls. It converges the Ajax umbrella into a beautiful and optimized solution for ASP.NET. In many of our demanding samples, No Re-Rendering takes place at all, except the initial load. This means:
  1. You can move a control between Control Collections and we'll just move the control in the Browser too :-)
  2. You can remove a control and replace it with a new control and if they are of the same type we will reuse that instance in the Browser and only emit the state changes. A great example is paging/sorting in the GridView: Only the Text property of the Labels get's serialized.
  3. You can remove a control entirely and we'll just issue a RemoveControlCommand to the Browser, not touching anything else.
  4. It also means a lot more to you, but we'll just have to expand information on this topic as we go.
DRIMR is such a powerful concept that you might not truly believe or understand what I am saying here, so I encourage you to check out for yourself. We hope DRIMR will inspire a whole new breed of web applications written purely in managed code that doesn't utilize unnecessary re-rendering strategies at all and we depend on you to create these masterpieces. The alternative route being a spaghetti of technologies blended together in a grey mass, colorless and with no distinguishable beauty. And you know how we feel about that now?

Interestingly DRIMR represents only a tiny fraction (1/107) of the tracker items that were solved for the 3.6 release. Imagine how many new features the 3.6 release contains? Other single items include: (>120++) New Samples, GridView, ImageMap, New Effect API, Validation Controls and numerous other features/enhancements.


120++ Samples

Lightbox and Carousel SampleOur brand new samples framework was written from scratch and each sample is now broken into a neatly organized folder structure. Many of the samples were written with extensibility in mind and should be easily customizable and integrated in your own appz. You also get a local copy of the samples when you install Gaia Ajax. Alternatively you can browse our samples online which we hopefully have mirrored somewhere near you:
Ajax GridView

Ajax GridView (for ASP.NET "Ninja" developers)

GridView is the prodigy of our DRIMR technology featuring

  • Dynamic inserts of rows/columns
  • Automatic removals,
  • Sorting and paging
  • + All other features available in the ASP.NET GridView (because it IS the ASP.NET GridView).

Example: If you select a row, Gaia detects that only a CssClass change took place, so that's the only thing Gaia "wires over". This in turn delivers a GridView with an amazing performance that you can use out of the box or upgrade your existing ASP.NET GridView. Instantly turn rows into edit mode, insert ANY control and get JSON-like serialization of data through familiar DataBind() operations in the codebehind. You can use WebServices if you want, but you don't have to, any collection will do just fine.

A potpourri of other interesting features

To economize on your precious time, allow me to just list up some additional things we hope you will enjoy in this release:
  1. New class based Effect API which allows
    1. Run multiple effects in parallel
    2. Run multiple effects in a queue
    3. Client side only effects
    4. Attaching to special control events (ie. Appear/Close)
    5. Lots of usage options
  2. Full IE6 support
    1. Css compatible
    2. Modal windows
    3. Samples Website 100% written for IE6
  3. Brand new controls
    1. ImageMap
    2. ValidatorControls
    3. BrowserHistory
    4. GridView
  4. Gaia Ajax 3.6 contains a total of 41 Server Controls. That's less than $5 pr/control! Let us know if you can write them cheaper, because then -You are hired! 
  5. AspectBinding to Events, Properties and methods. This means more native events are exposed on controls directly and the Modal property is back on Window. The TextBox for example now has:
    1. OnMouseOver
    2. OnMouseOut
    3. OnBlur
    4. OnFocus
    5. OnDoubleClick
    6. OnSelect
    7. + The rest which you already know
  6. Amazing new Drag&Drop capabilities. Dragging can now occur at the document level, circumventing stacking contexts, overflows and other obstacles when items are being dragged around. It also supports
    1. Ghosting
    2. Shallow Copies
    3. Custom CssClasses during Drag&Drop
  7. General Performance optimizations and JavaScript refactorings.
  8. The Nested Windows sample demonstrates how you can make the impossible possible with Gaia Ajax. In this sample we can add "unlimited" levels of modality recursively to nested Windows with roughly 20 lines of C# code!
  9. I've said it before and I'll say it again. Par example: the chess game does not perform re-rendering at all. All pieces are "physically" moved in the browser, captured pieces are replaced and non-valid moves slides the control back where it came from, and the best part: It's all written in 100% pure .NET managed code on the server. No Biz Exposed!

Here's a snippet of the server response during a piece capture:
   1:  Gaia.CRP('f7_black-pawn-f7','f3_white-queen-f3',1);
   2:  $G('f3_white-queen-3')
   3:  .setImageUrl('img/white_queen.png')
   4:  .setID('f7_white-queen-f7');

If you are still in doubt? Check out yourself and unleash the developer animal inside you! I don't have the stamina to continue this list so let me just quote one of our recent customers here: "Gaia is the best investment we've done in a LONG time!" -ConnectIT, Norway

How?

The 3.6 codename has been "fairytale" and was partially inspired by the MGP winner Alexander Rybak's song with the same name. We decided on that name just two months before the MGP final in Moscow due to a gut feeling that Alex would bring medals and honor home to Norway. I think Gemini reveals the publish date :-)

Development of Gaia Ajax is inspired from a mix of agile/bazaar techniques. Core development is mostly in-house, but external contributers are welcome to participate in the open forums/wiki/etc. Today many such contributions exist, including a full Outlook-like Scheduler written by Pavol. For a list of all extensions go here. The project enjoys a tight customer/community feedback loop with an instant report-confirm-fix-test-build-publish loop with our fully automated build system.

Other characteristics of the project include a high degree of transparency & Public Access to:

Compatibility

We've focused on backwards compatibility and for most cases you can do a binary upgrade by just replacing the dlls. ForceAnUpdate() is still hanging around, but should be safe in most scenarios to remove where Gaia only controls are in use. Doing so will result in vast speed improvements and reduced payload for ajax callbacks. for both the client and server, whereas DRIMR does not!

Note: Upgrade fails if you're doing a full custom implementation of IAjaxControl. However, inheriting directly from Gaia controls is considered safe.

Retracted Feature(s)

The alpha/beta release contained a selection of four new skins. These skins did not qualify our QA phase and unfortunately was removed. The skins are available in the SVN repositories under /gaia-ajax-skins/branches/ and they might be released in the future when quality is improved. However, we have plans to release more skins in the near future and these will be made available as a free add-on to the 3.6 release or in a future service pack to 3.6. We'll come back with more information regarding this in a few weeks.

Where?

Where to go from here? Well, that depends a great deal on where you are heading? If you are totally sold at this point (we certainly hope so), just pickup the SKU most suitable for you here: 

The installer is digitally signed (verifies authority) and integrates nicely with VS.NET 2005 & 2008 and you get a shortcut to a locally installed copy of the samples on your start menu. Opening the Samples in VS allows you to dissect the code and see for yourself how quickly you can build similar high quality code effortlessly.

Then I would suggest the following reading:
Here are a few selected samples which demonstrates some of the unique features of Gaia Ajax:

Conclusion

We hope you are going to love Gaia Ajax as much as we do. Also keep in mind that we truly want you to be successful with Gaia and that we are there for you when you need us. Don't hesitate to use email, forums, twitter, phone or any other surface we are exposed through.

Best Regards,
The Team behind Gaia Ajax

Gaia Ajax 3.6 Beta now available!

by Stian Solberg 21. October 2009 16:00

We're moving fast towards a final release. Current code is more and more stable, but we'd like the final release to be top quality and that's why we are releasing a beta.

Work done between Alpha and Beta:

Links and downloads

Get Free Download Gaia Ajax 3.6 Beta
Includes Visual Studio Integration and 100++ Samples

Changelog-Gaia-Ajax-3-6-Beta.pdf (106.52 kb)
Click here for Tar.gz binaries + source - for open source projects
Click here
if you are a subscription customer (requires login)

 

Comments and feedback are very welcome at our forum. Enjoy the new bits!

Kind regards
The Gaiaware Team


Time's up! Gaia Ajax 3.6 Alpha Released!

by Jan Blomquist 13. September 2009 21:01

Thank you for your patience and continued belief in our product. It is our vision to bring you the finest quality for ajax development on the ASP.NET platform. The 3.6 version comes with practical innovation previously unavailable to ASP.NET developers. Hopefully it will bring "goosebumps" similar to the ones we had the first time Microsoft unveiled ASP.NET almost a decade ago. 

"3.6 is backwards compatible and introduces a paradigm shift called adaptive rendering"

Links and downloads

  • Click here to download Gaia Ajax 3.6 "alpha"
    Exe with Visual Studio Integration 30 day trial

  • Click here to download Gaia Ajax 3.6 "alpha" - Tar.gz binaries + source - for open source projects
  • Click here to download Gaia Ajax 3.6 "alpha" commercial (requires subscription) 

Highlights from the Gaia Ajax 3.6 release

1. Adaptive Rendering
Adaptive Rendering is a mind-blowing concept that enables dynamic insertion, removal, moving and replacement of individual controls. The concept has far reaching implications and is the breakthrough technology that will make you hunger for Gaia as the building blocks for your UI layer

  • Click here for a sample that demonstrates dynamic inserts and removals of controls and compare it to the usage of traditional partial rendering
  • Click here for a sample of the chess game featuring dynamic control moves
  • Click here for a sample of our "PageFlakes" sample that also features dynamic moves
  • Click here to check out a sample that demonstrates all features of adaptive rendering, including control replacements via databinding
Jan Blomquist has written an extensive review of Adaptive Rendering on his personal blog.

2. Ajax GridView
The Gaia Ajax GridView is a premier example of adaptive rendering as it enables the worlds most advanced GridView for ASP.NET without much code at all. The GridView still supports all the operations like ( filtering, sorting, selection, deletions, updates, etc ) and it's all ajaxified thanks to adaptive rendering.  

  • Click here for a sample that demonstrates the Gaia Ajax GridView in action

3. 100++ new Samples!
In the package you will find a total of 128 samples ranging from minimalistic ones to extensive, almost full applications in themselves. This is all packaged into a new samples framework that simplifies navigation, code view, VB.NET code availability, etc. 

Note: The samples are now utilizing the WAP project type

More...

Summer Offer and what's coming in Gaia Ajax 3.6?

by Stian Solberg 23. July 2009 13:21

In good Gaiaware tradition we're spreading a refreshing summer breeze:

One Developer License of Gaia Ajax 3.5 "Themis" + One Developer License on the upcoming 3.6 (read more below on what's coming) for as little as $145. It also includes 2 x 1 month of support, 1 month of email support from purchase date on 3.5, as well as 1 month of support on 3.6 from release date.


Buy Now - Save 63% Today!
Expires 31st of July

What's coming in Gaia Ajax 3.6?

We have been working on 3.6 for a while already. It will be a great new step in the Gaia experience, making it even easier and more fun to create the next generation web applications. Here's what we're adding:

  • Aspect Binding
    Now you can add behaviours and events declarative to the Gaia controls. Want to set your Gaia Window modal? Just add the property Modal="True" and it is done! Subscribe to events like OnClick, OnDoubleClick, OnBlur, OnFocused, OnMouseOver, OnMouseOut, OnSelect ++ and your ASP.NET web application will never be the same.
  • New Gaia Effect library
    Faster and more effect options to choose from. Enjoy parallel and queued effects.
  • New Gaia History control
    Make friends with the browser navigation in your Ajax app.
  • New skins coming
    Office, IGaia, Portal and Social
  • New and richer GMap control
    We have spent some time on our Google Maps integration. Zoom, catch click events, add InfoWindows and pan to new coordinates. Finally Google Maps is for everyone!
  • New Gaia Ajax ImageMap control
    Just like the ASP.NET ImageMap control.
  • Advanced keyboard mapping
    Add keyboard integration to your web application. Another reason to go from desktop to web...
  • More features and events to Calendar and DateTimePicker
    We have added properties like FirstDayOfWeek and VisibleDate, and events like  OnCalendarDayClicking and OnDayRender
  • Core: Smaller JavaScript footprint
    In the work with revamping the Gaia Effects, we have moved script.aculo.us out of the core.
Want to test early? Take a look at the code? Get the source code, test a nightly build
Have a nice summer!
Best regards
The Gaiaware Team