This is a migrated thread and some comments may be shown as answers.

Problems while using Input Manager on a RadPageviewControl under RadTabStrip

7 Answers 69 Views
Input
This is a migrated thread and some comments may be shown as answers.
Ali
Top achievements
Rank 1
Ali asked on 15 Jul 2012, 05:24 AM
I have an aspx page in which I am loading 2 Radpageviews in form of tabs using RadTabstrip and RadMultiPageView. I want to add Input validation on a control present on one of the pageviews. When I do so using traditional methods, My tabstrip stops working and it does not switch on clicking on different tabs. It works fine if I don't add the inputmanager. Please Help me out to identify where I am going wrong.

<telerik:RadTabStrip ID="RadTabEntity" runat="server" MultiPageID="RadMultiPageEntity"
            SelectedIndex="0">
            <Tabs>
                <telerik:RadTab Text="Name & Address">
                </telerik:RadTab>
                <telerik:RadTab Text="Profile">
                </telerik:RadTab>
            </Tabs>
        </telerik:RadTabStrip>
        <telerik:RadMultiPage ID="RadMultiPageEntity" runat="server" SelectedIndex="0">
            <telerik:RadPageView ID="RadNameAddressPageView" runat="server">
                <table width="100%" style="border: Solid 3px #4b6c9e; width: 100%; height: 100%"
                    cellpadding="0" cellspacing="0">
                    <tr>
                        <td>
                            <div>
                                <asp:Literal runat="server" EnableViewState="true" ID="ltrMessagePopup"></asp:Literal>
                                <table>
                                    <tr>
                                        <td align="right">
                                            <asp:Literal ID="ltrIndividual" runat="server" Text="Type : "></asp:Literal>
                                            <asp:HiddenField ID="hdnfldEntityId" runat="server" Value="0" />
                                            <asp:HiddenField ID="hdnfldCompanyId" runat="server" Value="0" />
                                            <asp:HiddenField ID="hdnfldParentId" runat="server" Value="0" />
                                        </td>
                                        <td>
                                            <telerik:RadComboBox ID="ddlIndvComp" runat="server" OnSelectedIndexChanged="ddlIndvComp_SelectedIndexChanged"
                                                AutoPostBack="true">
                                                <Items>
                                                    <telerik:RadComboBoxItem Value="False" Text="Company" Selected="true" />
                                                </Items>
                                                <Items>
                                                    <telerik:RadComboBoxItem Value="True" Text="Individual" />
                                                </Items>
                                            </telerik:RadComboBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right">
                                            <asp:Literal ID="ltrTitle" runat="server" Text="Title :" Visible="false"></asp:Literal>
                                        </td>
                                        <td>
                                            <telerik:RadComboBox ID="ddlTitle" runat="server" Visible="false">
                                                <Items>
                                                    <telerik:RadComboBoxItem Text="Select Title" Selected="true" />
                                                </Items>
                                                <Items>
                                                    <telerik:RadComboBoxItem Value="Mr." Text="Mr." />
                                                </Items>
                                                <Items>
                                                    <telerik:RadComboBoxItem Value="Ms." Text="Ms." />
                                                </Items>
                                                <Items>
                                                    <telerik:RadComboBoxItem Value="Mrs." Text="Mrs." />
                                                </Items>
                                            </telerik:RadComboBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right">
                                            <asp:Literal ID="ltrFName" runat="server" Text="Name :"></asp:Literal>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtFName" runat="server" MaxLength="200" Width="250px"></asp:TextBox>
                                            <asp:CustomValidator runat="server" ID="cvFName" Display="None" ValidationGroup="popup"></asp:CustomValidator>
                                            <%--<asp:RequiredFieldValidator runat="server" ID="cvFName" Display="None" ControlToValidate="txtFName" ValidationGroup="popup"></asp:RequiredFieldValidator>--%>
                                            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="vceFName" TargetControlID="cvFName"
                                                HighlightCssClass="validatorCalloutHighlight" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right">
                                            <asp:Literal ID="ltrMName" runat="server" Text="Middle Name :" Visible="false"></asp:Literal>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtMName" runat="server" MaxLength="50" Width="250px" Visible="false"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right">
                                            <asp:Literal ID="ltrLName" runat="server" Text="Last Name :" Visible="false"></asp:Literal>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtLName" runat="server" MaxLength="50" Width="250px" Visible="false"></asp:TextBox>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <div>
                                Address Details
                                <asp:HiddenField runat="server" ID="hdnfldAddressId" Value="0" />
                                <table>
                                    <tr>
                                        <td align="right">
                                            Active From :
                                        </td>
                                        <%--<td><asp:TextBox runat="server" ID="txtFromDate"></asp:TextBox></td>--%>
                                        <td>
                                            <telerik:RadDatePicker ID="txtFromDate" runat="server" AllowEmpty="true">
                                            </telerik:RadDatePicker>
                                        </td>
                                        <td align="right">
                                            Inactive :
                                        </td>
                                        <td>
                                            <asp:CheckBox runat="server" ID="chkInactiveAddress" />
                                            <telerik:RadDatePicker ID="txtToDate" runat="server" AllowEmpty="true" Visible="false">
                                            </telerik:RadDatePicker>
                                            <%-- <asp:TextBox runat="server" ID="txtToDate" Visible="false"></asp:TextBox>--%>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right">
                                            <asp:Literal runat="server" ID="ltrAddressType" Text="Address Type :"></asp:Literal>
                                        </td>
                                        <td>
                                            <telerik:RadComboBox ID="ddlAddressType" runat="server">
                                                <Items>
                                                    <telerik:RadComboBoxItem Text="Office" Value="OFFICE" Selected="true" />
                                                </Items>
                                                <Items>
                                                    <telerik:RadComboBoxItem Text="Current Residence" Value="CUR_RES" />
                                                </Items>
                                                <Items>
                                                    <telerik:RadComboBoxItem Text="Permanent Residence" Value="PER_RES" />
                                                </Items>
                                            </telerik:RadComboBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right">
                                            Address1 :
                                        </td>
                                        <td>
                                            <asp:TextBox runat="server" ID="txtAddress1" MaxLength="100" Width="250px"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right">
                                            Address2 :
                                        </td>
                                        <td>
                                            <asp:TextBox runat="server" ID="txtAddress2" MaxLength="100" Width="250px"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right">
                                            Address3 :
                                        </td>
                                        <td>
                                            <asp:TextBox runat="server" ID="txtAddress3" MaxLength="100" Width="250px"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right">
                                            Country :
                                        </td>
                                        <td>
                                            <telerik:RadComboBox ID="ddlCountry" DataTextField="CountryName" DataValueField="CountryId"
                                                runat="server" OnSelectedIndexChanged="ddlCountry_SelectedIndexChanged" AutoPostBack="true">
                                            </telerik:RadComboBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right">
                                            <asp:Literal runat="server" ID="ltrState" Text="State :"></asp:Literal>
                                        </td>
                                        <td>
                                            <telerik:RadComboBox ID="ddlState" DataTextField="StateName" DataValueField="StateId"
                                                runat="server" OnSelectedIndexChanged="ddlState_SelectedIndexChanged" AutoPostBack="true"
                                                OnLoad="ddlState_SelectedIndexChanged">
                                            </telerik:RadComboBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right">
                                            <asp:Literal runat="server" ID="ltrCity" Text="City :"></asp:Literal>
                                        </td>
                                        <td>
                                            <telerik:RadComboBox ID="ddlCity" DataTextField="CityName" DataValueField="CityId"
                                                runat="server" AutoPostBack="true">
                                            </telerik:RadComboBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right">
                                            Pincode :
                                        </td>
                                        <td>
                                            <asp:TextBox runat="server" ID="txtPincode" MaxLength="15" Width="120px"></asp:TextBox>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </td>
                    </tr>
                </table>
            </telerik:RadPageView>
            <telerik:RadPageView ID="RadProfilePageView" runat="server">
                <%--OnLoad="PageView_DataBind"--%>
                <table width="100%" style="border: Solid 3px #4b6c9e; width: 100%; height: 100%"
                    cellpadding="0" cellspacing="0">
                    <tr>
                        <td>
                            <table>
                                <tr>
                                    <td align="right">
                                        <asp:Literal ID="ltrPAN" runat="server" Text="PAN No. :"></asp:Literal>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtPAN" runat="server" Width="200px"></asp:TextBox>
                                    </td>
                                </tr>
                                <%--<asp:RegularExpressionValidator ID="regExTextBox1" runat="server" ControlToValidate="txtPAN" ErrorMessage="Should be 16 Characters" ToolTip="Should be 16 Characters" ValidationExpression=".{16}." />--%>
                                <tr>
                                    <td align="right">
                                        <asp:Literal ID="ltrPFNo" runat="server" Text="PF No. :"></asp:Literal>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtPFNo" runat="server" MaxLength="20" Width="200px"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right">
                                        <asp:Literal ID="ltrLST_TinNo" runat="server" Text="Local Tin No. :"></asp:Literal>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtLST_TinNo" runat="server" MaxLength="16" Width="200px"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right">
                                        <asp:Literal ID="ltrLST_Tin_Date" runat="server" Text="Local Tin No. Date :"></asp:Literal>
                                    </td>
                                    <td>
                                        <telerik:RadDatePicker ID="txtLST_Tin_Date" runat="server" AllowEmpty="true">
                                        </telerik:RadDatePicker>
                                    </td>
                                </tr>
                                <%--<td align="right">Local Tin No. Date :</td>
                                    <td><asp:TextBox ID="txtLST_Tin_Date" runat="server" MaxLength="11" Width="200px"></asp:TextBox></td></tr>--%>
                                <tr>
                                    <td align="right">
                                        <asp:Literal ID="ltrCST_TinNo" runat="server" Text="CST Tin No. :"></asp:Literal>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtCST_TinNo" runat="server" MaxLength="16" Width="200px"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right">
                                        <asp:Literal ID="ltrCST_Tin_Date" runat="server" Text="CST Tin No. Date : "></asp:Literal>
                                    </td>
                                    <td>
                                        <telerik:RadDatePicker ID="txtCST_Tin_Date" runat="server" AllowEmpty="true">
                                        </telerik:RadDatePicker>
                                    </td>
                                </tr>
                                <%--<td align="right">CST Tin No. Date :</td>
                                    <td><asp:TextBox ID="txtCST_Tin_Date" runat="server" MaxLength="11" Width="200px"></asp:TextBox></td></tr>--%>
                                <tr>
                                    <td align="right">
                                        <asp:Literal ID="ltrST_No" runat="server" Text="ST No. :"></asp:Literal>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtST_No" runat="server" MaxLength="16" Width="200px"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right">
                                        <asp:Literal ID="ltrST_Reg_Date" runat="server" Text="ST Reg. Date :"></asp:Literal>
                                    </td>
                                    <td>
                                        <telerik:RadDatePicker ID="txtST_Reg_Date" runat="server" AllowEmpty="true">
                                        </telerik:RadDatePicker>
                                    </td>
                                </tr>
                                <%--<td align="right">ST Reg. Date :</td>
                                    <td><asp:TextBox ID="txtST_Reg_Date" runat="server" MaxLength="11" Width="200px"></asp:TextBox></td></tr>--%>
                                <tr>
                                    <td align="right">
                                        <asp:Literal ID="ltrECC_No" runat="server" Text="ECC No. :"></asp:Literal>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtECC_No" runat="server" MaxLength="20" Width="200px"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right">
                                        <asp:Literal ID="ltrPLA_No" runat="server" Text="PLA No. :"></asp:Literal>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtPLA_No" runat="server" MaxLength="20" Width="200px"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right">
                                        <asp:Literal ID="ltrTan_No" runat="server" Text="TAN No. :"></asp:Literal>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtTan_No" runat="server" MaxLength="16" Width="200px"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right">
                                        <asp:Literal ID="ltrCIN_No" runat="server" Text="CIN No. :"></asp:Literal>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtCIN_No" runat="server" MaxLength="18" Width="200px"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right">
                                        <asp:Literal ID="ltrIEC_No" runat="server" Text="IEC No. :"></asp:Literal>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtIEC_No" runat="server" MaxLength="10" Width="200px"></asp:TextBox>
                                    </td>
                                </tr>
                            </table>
                        </td>
                        <td>
                            <table>
                                <tr>
                                    <td align="right">
                                        <asp:Literal ID="ltrExc_No" runat="server" Text="Excise No. :"></asp:Literal>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtExc_No" runat="server" MaxLength="20" Width="200px"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right">
                                        <asp:Literal ID="ltrExc_Reg_Date" runat="server" Text="Excise Reg. Date :"></asp:Literal>
                                    </td>
                                    <td>
                                        <telerik:RadDatePicker ID="txtExc_Reg_Date" runat="server" AllowEmpty="true">
                                        </telerik:RadDatePicker>
                                    </td>
                                </tr>
                                <%--<td><asp:TextBox ID="txtExc_Reg_Date" runat="server" MaxLength="11" Width="200px"></asp:TextBox></td></tr>--%>
                                <tr>
                                    <td align="right">
                                        <asp:Literal ID="ltrExc_Division" runat="server" Text="Excise Division :"></asp:Literal>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtExc_Division" runat="server" MaxLength="20" Width="200px"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right">
                                        <asp:Literal ID="ltrExc_Range" runat="server" Text="Excise Range :"></asp:Literal>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtExc_Range" runat="server" MaxLength="20" Width="200px"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right">
                                        <asp:Literal ID="ltrExcRange_Address" runat="server" Text="Excise Range Address :"></asp:Literal>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtExcRange_Address" runat="server" MaxLength="100" Width="200px"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right">
                                        <asp:Literal ID="ltrExc_Coll" runat="server" Text="Excise Collectorate :"></asp:Literal>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtExc_Coll" runat="server" MaxLength="20" Width="200px"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right">
                                        <asp:Literal ID="ltrTDS_No" runat="server" Text="TDS No. :"></asp:Literal>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtTDS_No" runat="server" MaxLength="10" Width="200px"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right">
                                        <asp:Literal ID="ltrTDS_Reg_Date" runat="server" Text="TDS Reg. Date :"></asp:Literal>
                                    </td>
                                    <td>
                                        <telerik:RadDatePicker ID="txtTDS_Reg_Date" runat="server" AllowEmpty="true">
                                        </telerik:RadDatePicker>
                                    </td>
                                </tr>
                                <%--<td><asp:TextBox ID="txtTDS_Reg_Date" runat="server" MaxLength="11" Width="200px"></asp:TextBox></td></tr>--%>
                                <tr>
                                    <td align="right">
                                        <asp:Literal ID="ltrTDS_Circle" runat="server" Text="TDS Circle :"></asp:Literal>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtTDS_Circle" runat="server" MaxLength="20" Width="200px"></asp:TextBox>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </telerik:RadPageView>
        </telerik:RadMultiPage>
        <div style="text-align: center;">
            <asp:Button ID="btnSave" runat="server" SkinID="Button" Text="Save" OnClick="btnSave_Click" />
            <asp:Button ID="btnCancel" runat="server" SkinID="AltButton" Text="Cancel" OnClientClick="CloseAndRebind(); return false;" />
        </div>
        <div>
            <telerik:RadInputManager ID="RadInputManager1" runat="server">
            <telerik:RegExpTextBoxSetting BehaviorID="RegExpBehavior1" InitializeOnClient="false"
                ErrorMessage="PAN number should be equal to 16 digits" InvalidCssClass="invalid" ValidationExpression=".{16}">
                <Validation IsRequired="true" />
                <TargetControls>
                    <telerik:TargetInput ControlID="txtPAN" />
                </TargetControls>
            </telerik:RegExpTextBoxSetting>
        </telerik:RadInputManager>

7 Answers, 1 is accepted

Sort by
0
Vasil
Telerik team
answered on 19 Jul 2012, 05:50 AM
Hi Ali,

Please confirm that you have enabled the Script Debugging in your browser and tell us know if you get any JavaScript errors.

Greetings,
Vasil
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Ali
Top achievements
Rank 1
answered on 01 Aug 2012, 08:39 AM
Thanks for the reply Vasil .

The issue subsided automatically after a while. I think there must be some other code interfering with it. Everything is fine now and the input manager is working normally.

But I had another query. How can i prevent input manager from blocking tab change(as i recon it requires a postback) if there is invalid input in any control of the current tab. I have a button for submitting all the tabs data at once and want input validator to kick in when i press the save button.
0
Accepted
Vasil
Telerik team
answered on 01 Aug 2012, 02:22 PM
Hello Ali,

Setting CausesValidation="false" to your RadTabStrip, should disable the validation during navigation.

Greetings,
Vasil
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Ali
Top achievements
Rank 1
answered on 03 Aug 2012, 12:11 PM
Hi Vasil,

I have another problem, I want to set focus to the control which causes validation failure. As I have many tabs , the user after clicking the submit button will not know what just happened if the control to cause validation is not on the same tab . Is there any way I set focus to the control causing validation problems. I have seen a solution but that does not seem to be working in my case. Here is the link http://www.telerik.com/community/forums/aspnet-ajax/general-discussions/radinputmanager-focus-on-error.aspx.

Thanks and Sorry for wasting your time on such silly issues. :)
0
Vasil
Telerik team
answered on 08 Aug 2012, 10:52 AM
Hi Ali,

When the validated input is in different tab and it is not visible, it will not get the focus.
However you can try to set SetFocusOnError="true" for one validator, and test if the onfocus event of the input element is fired even if it is on another tab. If it is fired, you can actually change the tab depending on the control.

All the best,
Vasil
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Ali
Top achievements
Rank 1
answered on 09 Aug 2012, 05:02 AM
Exactly where do you want me to use SetFocusOnError property? Cause I am using radinputmanager with textbox setting and adding SetFocusOnError on either of them is giving me an error "Type 'Telerik.Web.UI.TextBoxSetting' does not have a public property named 'SetFocusOnError'".
Are you asking me to add this in requiredfieldvalidator, because I am not using any so I will not be able to do so.
0
Vasil
Telerik team
answered on 10 Aug 2012, 02:58 PM
Hi Ali,

Yes I was thinking about the asp Validator's SetFocusOnError property. I am unable to come up with a solution for focusing the correct tab on validation error of a control inside it. You can try to use custom validators that to handle manually. But there is no build in solution that can be applied with the InputManager and such configuration of the TabStrip.

All the best,
Vasil
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Input
Asked by
Ali
Top achievements
Rank 1
Answers by
Vasil
Telerik team
Ali
Top achievements
Rank 1
Share this question
or