Spring.NET validation integration

  1. #1

    Spring.NET validation integration

    Hi,

    I do realize this is a bit of a big subject but here goes:

    My current project requires me to work with the Spring.NET framework. This framework provides validation including a control. Since this control does not subclass Coolite.Ext.Web.Component I cannot use it inside an AnchorLayout. Instead Spring.NET comes with a ValidationError control that subclasses AbstractValidationControl that subclasses System.Web.UI.Control.

    Requirements are:
    - Must participate in ext layouts
    - Must be able to display/hide and change message after an asynchronous callback

    Unfortunately this seems tricky since both these requirements seem to depend on subclassing a concrete class rather than implementing an interface. At the moment it seems easiest to write sort of an adaptor control that subclasses Coolite.Ext.Web.Component and references a Spring.Web.UI.Controls.AbstractValidationControl that defers rendering of validation errors to the Coolite.Ext.Web.Component.

    Any thoughts or pointers on this?

    Regards,

    Dirk Louwers
  2. #2

    RE: Spring.NET validation integration

    Hi Dirk,

    What about if place to AnchorLayout the Coolite Panel, set for panel Border="false" and no header. Then you can put your control to the panel body.


    Is it acceptable solution?


  3. #3

    RE: Spring.NET validation integration

    Hi,

    That would solve part of the problem, but would it also allow for asynchronous callbacks to update the message and toggle visibility? I am striving for as tight an integration as possible.

    Best,

    Dirk Louwers
  4. #4

    RE: Spring.NET validation integration

    I've ran some tests to see if at least it can be used inside a form layout but that causes problems. I need to multiple controls on a single line inside a form layout with a single label. The anchor can only contain a single control. Therefore I have used a panel with a 3 column table layout inside. The third cell contains a panel containing the validation control.

    This leaves me with no way to set the label, because the anchor doesn't pick it up any more because the panel doesn't have a FieldLabel property. I think anchor should have a FieldLabel property to set the field label in case the control contained doesn't have the FieldLabel property (like Panel).

    Best,

    Dirk Louwers
  5. #5

    RE: Spring.NET validation integration

    Hi Dirk,

    Please see the following example which shows how to place several fields in one line
    https://examples1.ext.net/#/Layout/FormLayout/Overview/
    *
  6. #6

    RE: Spring.NET validation integration

    Hi Vladimir,

    I have seem these examples. None of them illustrate what I need. I need multiple controls with a single label. All the examples illustrate one label per control situations.

    Best,

    Dirk Louwers
  7. #7

    RE: Spring.NET validation integration

    Hi Dirk,

    You can hide labels for controls which don't require show a label
    Please see the following example
    <%@ Page Language="C#" EnableViewState="false" %>
    <%@ Import Namespace="System.Globalization"%>
    <%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
        <title>Example</title>
    </head>
    <body style="padding:10px;">
        <form id="form1" runat="server">
            <ext:ScriptManager ID="ScriptManager1" runat="server" ScriptMode="Debug" />
            
            <ext:Panel 
                runat="server" 
                Title="Title" 
                Frame="true"
                BodyStyle="padding:5px 5px 0;"
                Width="600">
                <Body>
                    <ext:Panel ID="Panel1" runat="server">
                        <Body>
                            <ext:ColumnLayout ID="ColumnLayout1" runat="server">
                                <ext:LayoutColumn ColumnWidth=".6">
                                    <ext:Panel ID="Panel2" runat="server" Border="false" Header="false">
                                        <Body>
                                            <ext:FormLayout ID="FormLayout1" runat="server">
                                                <ext:Anchor Horizontal="95%">
                                                    <ext:TextField ID="TextField1" runat="server" FieldLabel="First Name" />
                                                </ext:Anchor>
                                                <ext:Anchor Horizontal="95%">
                                                    <ext:TextField ID="TextField2" runat="server" FieldLabel="Company" />
                                                </ext:Anchor>
                                            </ext:FormLayout>
                                        </Body>
                                    </ext:Panel>
                                </ext:LayoutColumn>
                                <ext:LayoutColumn ColumnWidth=".4">
                                    <ext:Panel runat="server">
                                        <Body>
                                            <ext:FormLayout ID="FormLayout2" runat="server" HideLabels="true">
                                                <ext:Anchor Horizontal="95%">
                                                    <ext:TextField ID="TextField3" runat="server"/>
                                                </ext:Anchor>
                                                <ext:Anchor Horizontal="95%">
                                                    <ext:TextField ID="TextField4" runat="server" />
                                                </ext:Anchor>
                                            </ext:FormLayout>
                                        </Body>
                                    </ext:Panel>
                                </ext:LayoutColumn>
                            </ext:ColumnLayout>
                        </Body>
                    </ext:Panel>
                </Body>
            </ext:Panel>
            
        </form>
    </body>
    </html>

Similar Threads

  1. tighter integration between coolite and visual studio
    By bsmokeman in forum Open Discussions
    Replies: 3
    Last Post: Feb 06, 2012, 10:51 PM
  2. Replies: 3
    Last Post: Jul 11, 2011, 9:43 AM
  3. Ext.Net usage with Spring.Net Framework
    By suchit_patel in forum Open Discussions
    Replies: 2
    Last Post: Aug 20, 2010, 6:04 AM
  4. Replies: 1
    Last Post: Apr 12, 2009, 10:04 AM
  5. Integration with Web Part Personalization
    By jallenby in forum 1.x Help
    Replies: 2
    Last Post: Nov 05, 2008, 5:30 AM

Posting Permissions