Firefox needs two clicks to set validators correct

208 Views Asked by At

I have a strange problem, but I can't get a solution: We use the Infragistics WebDataGrid, in which I set a dropdown and a textbox. For both of them I set a requiredfieldvalidator:

                            <asp:RequiredFieldValidator ValidationGroup="attrib" runat="server" ControlToValidate="ddlIndRoleAttribType" ToolTip="Attribute Type is not set." InitialValue="-- not selected --" Text="!" Display="Dynamic" />
                        </div>
                    </ItemTemplate>
                </ig:TemplateDataField>
                <ig:TemplateDataField Header-Text="Value" Key="IndRoleAttribVal" Width="50%">
                    <ItemTemplate>
                        <div>
                            <stgwc:TextEdit runat="server" Width="300px" ID="txtIndRoleAttribValue" />
                            <asp:RequiredFieldValidator ValidationGroup="attrib" runat="server" ControlToValidate="txtIndRoleAttribValue" Width="90%" ToolTip="Attribute Value is not set." Text="!" Display="Dynamic" />
                        </div>
                    </ItemTemplate>
                </ig:TemplateDataField>
                <ig:TemplateDataField Header-Text="Action" Key="IndRoleAttribAction" Width="40px">
                    <HeaderTemplate>                            
                        <stgwc:ImageLinkButton runat="server" ID="btnCreateNewAttribute" CausesValidation="false"  ImageUrl="~/Images/base/Icons/16x16/add2.png"
                            ToolTip="Add new Attribute" CommandName="Create" />

                        <stgwc:ImageLinkButton runat="server" ID="btnSaveAllAttributes" ValidationGroup="attrib" ImageUrl="~/Images/base/Icons/16x16/disk_green.png"
                            ToolTip="Save all Attributes"  CommandName="Save" />

                        <stgwc:ImageLinkButton runat="server" ID="btnCancelChanges" CausesValidation="false" ImageUrl="~/Images/base/Icons/16x16/undo.png"
                        CommandName="Cancel" ToolTip="Discard changes" />
                    </HeaderTemplate>
                    <ItemTemplate>
                        <stgwc:ImageLinkButton runat="server" ID="btnDeleteAttribute" CausesValidation="false" ImageUrl="~/Images/base/Icons/16x16/delete2.png"
                            ToolTip="Delete this Attribute"  CommandName="Delete" CommandArgument='<%# Bind("IR_ATTR_ID") %>' />
                    </ItemTemplate>
                </ig:TemplateDataField>
            </Columns>
        </stgwc:WebDataGrid>

I do a postback if a new item should be created, then I set it to the datasource and reload it, something like this:

        dgrIndRoleAttributes.ClearDataSource();
        dgrIndRoleAttributes.Rows.Clear();

        dgrIndRoleAttributes.DataSource = null;
        dgrIndRoleAttributes.DataSource =
            (Session[Constants.Session.RoleAttributes.ToString()] as List<TmpIndRoleAttribute>);
        dgrIndRoleAttributes.DataBind();

Now comes the funny part: When I press enter after adding a new row, Firefox (only Firefox, on IE it works proper), seems to think the validators on the validator-group attrib arent set proper and I need to click twice, to make it save.
If I check this with the firebug, I see both validators being on display: none, so this cant be problem. As said, this happens only on Firefox, and I cant reproduce it on a small testsample.

Has anyone a idea, what could cause this behavior? Since I'm not used to this validators, I can't imagine, what could cause this problems.

Thanks for you response!

Matthias

Edith says: It's a infragistics bug... Another one... I use in this case the normal asp textbox and change the style with some css.

0

There are 0 best solutions below