ATLAS/AJAX and LLBLGen

Posts   
 
    
Devildog74
User
Posts: 719
Joined: 04-Feb-2004
# Posted on: 22-Feb-2006 06:26:43   

Has anyone looked into or toyed with using the ATLAS CTP / AJAX techniques and LLBLGen pro?

If so what were the results?

Posts: 497
Joined: 08-Apr-2004
# Posted on: 22-Feb-2006 10:26:59   

I'm interested too !!

From what I hear, Anthem is the ajax implementation choice over atlas (http://sourceforge.net/projects/anthem-dot-net), its up there on the list of things I really want to look into, but this darn day job keeps getting in the way wink

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 22-Feb-2006 11:32:28   

Isn't ajax forcing you to work with shiver javascript?

Frans Bouma | Lead developer LLBLGen Pro
Devildog74
User
Posts: 719
Joined: 04-Feb-2004
# Posted on: 22-Feb-2006 12:24:29   

Regarding javascript, yes technically, but depending on the library that you use, the developer interaction with javascript is limited.

Atlas, for example has asp.net server side controls that when rendered in the browser, pump in the javascript hooks. The libraries also have javascript wrappers that make life easier.

To roll your own implementation is tedious.

Apparently atlas has server side controls that can be declaritively programmed to support databinding, so the general theory is that it shouldnt be that bad to databind results returned from server side code, because the atlas api, supposedly handles parsing the results from xml into a useable client side format.

This is all the theory.

Devildog74
User
Posts: 719
Joined: 04-Feb-2004
# Posted on: 23-Feb-2006 07:41:42   

Today I finally took some time to work with AJAX and LLBLGen. It was amazingly simple using the ComponentArt Callback control.

The purpose of the exercise was to see how easy it was to implement AJAX techniques with LLBLGen as the data source. In my sample, I click a hypelink and get some data without the postback.

In my implementation, I created a web service that fetched all employees from northwind into a typed list and returned a typed list from a web service as a data set. I created a simple web form with a data grid and a CA Callback control. Then I wrote the client side javascript and code behind callback method.

The code behind callback was very simple, it simply invokes a web method, sets data source of the data grid to the result of the web method, and renders the output of the data grid to the CA Callback control.

Implementing AJAX using ATLAS appears to be much more hassle than its worth especially considering I was up and running with the CA Callback control in < 20 minutes. Like typical Microsoft Sanctioned projects, there is little documentation for implementing ATLAS outside of the standard "Hello World" implementation, and besides that the declarative model seems very counter intuitive.

I have included the highlights of the code below. One thing to note is that I did not need to get the data from a web service, I just chose to use a web service because I already had one lying around that I could use. Because the CA Callback allows you to get into the code behind you can go directly to a LLBLGen library and get the EntityCollection, Entity, TypedList, TypedView, or whatever else you might want to do.

I did the sample in VS.NET 2005 if anyone wants to see the source, let me know.

The Client Side javascript looks like this:


<script type="text/javascript">
function renderControl(param)
{
  Callback1.Callback(param); 
}
</script> 

The code behind callback method looks like this:


    protected void Callback1_Callback(object sender, ComponentArt.Web.UI.CallBackEventArgs e)
    {
        FADV.Services.Northwind.NorthwindServices svc = new FADV.Services.Northwind.NorthwindServices();
        DataTable table = svc.GetAllEmployees().Tables[0];
        DataGrid1.Visible = true;
        DataGrid1.DataSource = table;
        DataGrid1.DataBind();
        
        DataGrid1.RenderControl(e.Output);
    }

The client html in the asp.net page looks like this:


<form id="form1" runat="server">
<div>
<a href="javascript:renderControl('');">Get Employees</a>
    <br />
    <ComponentArt:CallBack ID="Callback1" runat="server" Height="250" OnCallback="Callback1_Callback"
        Width="350">
        <Content>       
        </Content>
    </ComponentArt:CallBack>
    <asp:DataGrid ID="DataGrid1" runat="server" CellPadding="4" ForeColor="#333333" GridLines="None"
        Style="border-right: #666666 1px solid; border-top: #666666 1px solid; border-left: #666666 1px solid;
        border-bottom: #666666 1px solid" Visible="False">
    </asp:DataGrid> 
</div>
</form>

Shortie
User
Posts: 18
Joined: 17-Dec-2004
# Posted on: 23-Feb-2006 12:56:31   

This week I also tested some AJAX features with my LLBLgen project. I read the good things about Anthem and decided to give it a try. It works perfect. I have a dropdownlist which is input for a second dropdownlist. Before I had a complete postback of the page to reset the second dropdownlist which caused some annoying flikker of the website. Now only a small blink of the second dropdownbox is visible after updating its content. This took me only some very minor changes in the code. For what it's worth my code:

ASCX page


<%@ Register TagPrefix="anthem" Namespace="Anthem" Assembly="Anthem" %>


    <tr>
        <td style="HEIGHT: 20px"><anthem:dropdownlist id="cmbPijler" runat="server" Width="125px" AutoCallback="True" CssClass="zoekform"
                DataValueField="ID" DataTextField="Naam"></anthem:dropdownlist></td>
    </tr>
    <tr>
        <td><anthem:dropdownlist id="cmbRubriek" runat="server" DataValueField="ID" DataTextField="Omschrijving"
                Width="125px" CssClass="zoekform"></anthem:dropdownlist></td>
    </tr>


Notice the change from <asp: dropdownlist to <anthem: dropdownlist. And ofcourse the registration of the anthem prefix.

In the SelectedIndexChanged event of the first dropdownlist I added only one line of code with the UpdateAfterCallBack option


 Private Sub cmbPijler_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmbPijler.SelectedIndexChanged
        ' Reset de rubriekenlijst op basis van de gekozen pijler
        Session.Remove("zoeken_rubriek")
        resetRubrieken()
        cmbRubriek.UpdateAfterCallBack = True
    End Sub

The binding of the dropdownlist didn't change at all.

Devildog74
User
Posts: 719
Joined: 04-Feb-2004
# Posted on: 23-Feb-2006 13:23:01   

Thats pretty sweet. I think the new direction that atlas is heading in is that Microsoft doesnt want to add new controls, but they want to extend exsitng server side controls to support AJAX.

That is also another cool thing about the Telerik and ComponentArt Callback tools, you work with intrinsic ASP.NET control and tie them together with the 3rd party callback controls.

swallace
User
Posts: 648
Joined: 18-Aug-2003
# Posted on: 23-Feb-2006 15:14:23   

I'm a fan of this Michael Schwarz's AJAX tools for .NET:

http://dotnet2.schwarz-interactive.de/

About a year ago I wanted to experiment with AJAX so I built a site:

http://www.nearbinder.com

to see how .NET and LLBLGenPro handle it. You have to sign up to get the full effect, but it's pretty cool. Things to note that are cool about the site, the 'busy' indicator during data loads, the yellow flash on forms to draw user attention to their next step, the expanding box for forms presentation, and more.

Was it worth the (not insignificant) effort just to include a cool AJAX feel? I'm undecided. You tell me.

While I look forward to Microsoft's Atlas project, but it's nowhere near as fully-featured as Schwarz's tool is today.