Lives: 30

Grid Configuration via Web Service

Posted Fri Jun 13, 2008 @ 6:35 AM


Since the introduction of the WebService running mode in ComponentArt Grid, and related functionality (like the client-side load method), we have seen this approach rapidly gain popularity and, naturally, produce demands for more features and more versatility.

Versatility is key when it comes to UI controls, so we have been spending some time improving WebService mode in this respect. As of Web.UI 2008.2 SP2 (build 2008.2.1180) Grid has a number of new features.

WebServiceConfigMethod

In addition to being able to define ASP.NET AJAX web service methods for data selection, insertion, deletion, etc, it is now also possible to perform Grid configuration in a web service.

Rather than defining top-level properties, GridLevels and their constituent GridColumns and all the accompanying styles on the ASPX page where the Grid instance is placed, all of these can now be loaded on the fly by defining the WebServiceConfigMethod server-side property and calling the client-side webServiceConfig method.

GridWebServiceConfigResponse

The web service method performing Grid configuration is expected to return an object of the type GridWebServiceConfigResponse. Such an object contains top-level property settings (contained in the Properties member), and GridLevel definitions (contained in the Levels property) which, in turn, can contain GridColumns.

Configuration can be done at any time on the client, without going back to the server from which the ASPX file originated. The configuration request passes in an optional custom parameter, so that configuration can be context-dependent.

GridWebServiceSelectRequest.Columns

To enable such potential on-the-fly changes to the Grid’s layout and definition, GridWebServiceSelectRequest now contains a Columns property. With every web service data request, Grid now sends along the collection of columns (data fields) that it expects on the client. This allows the web service selection logic to account for on-the-fly changes in the Grid’s client-side configuration, and always provide the required data.

And More

In addition to the above, a number of other enhancements to web service functionality have been made which should simplify its use in many scenarios and enable altogether new ones.

For example, GridWebServiceSelectResponse.Items can now contain simple arrays of objects corresponding to the rows of data requested by the Grid. Simple proxy classes no longer need to be defined, as long as the order of data in the arrays matches the fields specified in GridWebServiceSelectRequest.Columns.

The select response can now also contain hierarchical data, with rows containing more rows defined on the second (or third, etc) GridLevel. To keep on topic, I will write more on this particular functionality at a later date.

Cheers, and thanks for stopping by!

Posted to Milos Glisic by milos

Posted on Fri Jun 13, 2008 @ 6:35 AM

Filed under: , , ,

Comments

Russ Suter
Posted on Fri Jun 13, 2008 @ 6:35 AM
This sounds Great. So when will it be available? I love the web service functionality but all my FormatString arguments are completely ignored. Will the next release fix this?
Mike
Posted on Fri Jun 13, 2008 @ 6:35 AM
Web service setup is great, but when are you going to flesh out the documentation and samples? How about a sample grid that uses WS and does inserts, selects, deleting, sorting, filtering, and editing with dropdown for foreign relationships? I'm having a hard time between docs, blogs and forums trying to figure out what I can /can't do with this. As an example, why is there no delete? Is there another way of doing this? I see you mention it above. Is it in SP2? Why do you release this stuff without fully documenting?
milos
Posted on Fri Jun 13, 2008 @ 6:35 AM
Mike, we are working on incrementally enhancing this functionality, along with docs and demos. In fact, it's going to be the focus of our work on Grid in the coming months. It is true that the initial offering isn't adequately documented, but you'll find that we've been addressing that, and the latest SP release already includes a much-improved Grid reference. It also includes WS-delete functionality (WebServiceDeleteMethod property, GridWebServiceDeleteRequest class). Without meaning to excuse anything, the web service functionality was added as an experiment, which we feel has been a success and which we will therefore invest in more seriously in the future as *the* preferred web app architecture. Russ, the problems with FormatString (and others) are something we're going to address as soon as possible. The issue is that such formatting was always done on the server housing the ASPX file, as the Grid had full control over processing the data before writing it to the client. With web services, we don't have full control over serialization, and the web service doesn't know about all the settings (like column formats) set on the Grid. We are working to solve these issues. In the meantime, you could force a format inside your web service as you populate the data to be returned. I hope this helps.
Jon
Posted on Fri Jun 13, 2008 @ 6:35 AM
you guys can really help yourselves by adequately documenting these features. i'm sure you've got the right solution its just that i can't find it or the appropriate documentation - this is inhibiting the uptake of the grid within the organisation i work for, and probably others... less all-in-one examples, more step-by-step's please!
Posted on Fri Jun 13, 2008 @ 6:35 AM

I am not able to consume web service using running mode.

I tried what ever mentioned in the blog or article.

It keeps on giving me same error "PersonService.IPersonService" is null or not an object.

IPersonService is the contract I am consuming.

Help me out with this problem. My mind is busted out I am doing this from last 24hrs.

Thanks

Mayank

Posted on Fri Jun 13, 2008 @ 6:35 AM

mayank.aroa:  seems like you are using wcf instead of a webservice.  

Look at this example www.componentart.com/.../38486.aspx and then be sure to add the following attribute to your service:     [ServiceKnownType(typeof(myObject))]

Anonymous comments are not allowed. Click here to log in or create an account.

Copyright © 2010 ComponentArt, Inc. All rights reserved.