PDA

View Full Version : Using DataBind with Spring.NET in Visual Studio



diego.damohill
03-04-2011, 01:40 PM
Hello, I work in a web application that must use Spring.Net. The model of the project works with entities, but we want to use Spring to avoid situations such as:

Entity.property = TextBox.Text;

The project also has layers like DAO which makes direct access to the database, facades that make the bridge between the Web page code and services, and services that make the connection between the facade and DAO

I would like to help me understand how I can use the controls of Spring in a model like this. I'm trying to learn why I joined recently in Spring.Net project.
:confused:

Mark Pollack
03-04-2011, 02:46 PM
Hi,

Have you looked into the documentation on the Spring.NET web framework?

http://www.springframework.net/doc-latest/reference/html/web.html

Specifically, for the type of situation you talk about,

Entity.property = TextBox.Text;

there is a binding feature of the framework that lets you declaratively configure this databinding so that it works both from the controls into your entity and then after your entity comes out of a service layer, binds back from the entity to the controls. More information is available here

http://www.springframework.net/doc-latest/reference/html/web.html#web-databinding

There is also a couple of example applications to get you started. The examples that cover individual features of the spring.net web framework are in the installation directory

<spring-install-dir>\examples\Spring\Spring.WebQuickStart

There you can find examples on dependency injection for web forms and controls, data binding, page flow, etc. The documention inside the solution and web application itself can help guide you through the functionality.

For a more complete example, look at the SpringAir example application. That is documented here

http://www.springframework.net/doc-latest/reference/html/springair.html

and covers a wide range of features including how to integrate your service and DAO layers.

Hope this helps.

Mark

diego.damohill
03-11-2011, 05:08 PM
I've implemented the methods of Spring.Web.UI.Page, like the InitializeDataBindings, SaveModel, loadModel and so on. I mentioned the control of the spring on the page, and put the property BindingTarget fields. But when I save, the fields are not filled, any idea what could be?