[CLOSED] The active error of a composite field is not nice

  1. #1

    [CLOSED] The active error of a composite field is not nice

    Hi,

    I'm developing a utility which does like the ASP.NET Validation Summary control does by collecting client error messages and show them in an alert dialog. However, I see that the composite field control attaches client id of its item into the active error message. That is not nice. I suggest to use item's field label instead.

    I'm looking forward to receiving your reply.

    Regards,
    Attached Thumbnails Click image for larger version. 

Name:	compositefield.png 
Views:	132 
Size:	29.6 KB 
ID:	1934  
    Last edited by Daniil; Nov 24, 2010 at 8:57 AM. Reason: [CLOSED]
  2. #2
    Hi,

    If FieldLabel is defined this is used instead of id to combine error message. The following example demonstrates this behavior.

    Can we have a look at a piece of code where the fields are defined?

    Example
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" 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 runat="server">
        <title>Ext.Net Example</title>
        <ext:ResourcePlaceHolder runat="server" />
    
        <script type="text/javascript">
            Ext.onReady(function() {
                cf1.validate();    
            });
        </script>
    </head>
    <body>
        <form runat="server">
        <ext:ResourceManager runat="server" />
        <ext:CompositeField ID="cf1" runat="server" FieldLabel="CompositeField">
            <Items>
                <ext:TextField ID="TextFieldId" runat="server" AllowBlank="false" />
                <ext:TextField runat="server" AllowBlank="false" FieldLabel="FieldLabel" />
            </Items>
        </ext:CompositeField>
        <ext:Button runat="server" Text="Get an error message">
            <Listeners>
                <Click Handler="var errorMessage = cf1.buildCombinedErrorMessage(cf1.fieldErrors.items);
                                Ext.Msg.show({ width: 300, height: 300, msg: errorMessage});" />
            </Listeners>
        </ext:Button>
        </form>
    </body>
    </html>
    Last edited by Daniil; Nov 24, 2010 at 8:57 AM.
  3. #3
    Hi,

    You are right. It was my mistake.

    Thank you in advance.

Similar Threads

  1. RTL for Composite Field
    By ahmadezzeir in forum 1.x Help
    Replies: 3
    Last Post: May 17, 2012, 8:25 PM
  2. Replies: 1
    Last Post: Oct 07, 2011, 8:34 AM
  3. Replies: 2
    Last Post: Sep 22, 2011, 11:46 AM
  4. [CLOSED] Problem with Composite Field
    By tansu in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Aug 22, 2011, 4:06 PM
  5. Replies: 2
    Last Post: Aug 19, 2011, 1:36 PM

Posting Permissions