subbareddy s
Top achievements
Rank 1
subbareddy s
asked on 23 Oct 2012, 04:30 PM
Hi,
I have one rad combo box , text box and a submit button at my rad window popup. At the time close popup at 'OnClientClose' i have cleared the rad combo box selection at client side as per below snippet,
var comboDeactivateReasonTruck = $find("<%= cboDeactivateReasonTruck.ClientID %>");
comboDeactivateReasonTruck.clearSelection();
comboDeactivateReasonTruck.commitChanges();
but internally the event for that respective combobox is not cleared. So when i trying to click on submit now at that first time if we have any validation message then its working fine ,now we are close that window popup and reopen and click again on submit instead of that submit event combobox event has been fired and nothing is happened. Is there any solution for that..?
Thanks in Advance...
Regards,
Subbu
I have one rad combo box , text box and a submit button at my rad window popup. At the time close popup at 'OnClientClose' i have cleared the rad combo box selection at client side as per below snippet,
var comboDeactivateReasonTruck = $find("<%= cboDeactivateReasonTruck.ClientID %>");
comboDeactivateReasonTruck.clearSelection();
comboDeactivateReasonTruck.commitChanges();
but internally the event for that respective combobox is not cleared. So when i trying to click on submit now at that first time if we have any validation message then its working fine ,now we are close that window popup and reopen and click again on submit instead of that submit event combobox event has been fired and nothing is happened. Is there any solution for that..?
Thanks in Advance...
Regards,
Subbu
8 Answers, 1 is accepted
0
Hello Subbu,
Could you please elaborate a bit more on your scenario?
I prepared a sample project following your description and RadComboBox clear selection is working fine at my side.
Note that if RadComboBox object clearSelection() method is used, the RadComboBox selected item is null. Therefore any usage of this selected item will return null or nothing will happened if its is used in functions or variables.
Please try to modify the attached project in order to inspect your issue deeper and be more helpful.
Looking forward for your reply.
Regards,
Boyan Dimitrov
the Telerik team
Could you please elaborate a bit more on your scenario?
I prepared a sample project following your description and RadComboBox clear selection is working fine at my side.
Note that if RadComboBox object clearSelection() method is used, the RadComboBox selected item is null. Therefore any usage of this selected item will return null or nothing will happened if its is used in functions or variables.
Please try to modify the attached project in order to inspect your issue deeper and be more helpful.
Looking forward for your reply.
Regards,
Boyan Dimitrov
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
subbareddy s
Top achievements
Rank 1
answered on 25 Oct 2012, 02:46 PM
Hi Boyan,
Thanks for reply. Here i have placed my code.. please find that..
---------------------
.aspx
---------------------
<telerik:RadScriptBlock ID="rsb" runat="server">
<script language="JavaScript" type="text/javascript">
function OnTruckCloseHandler(sender, args) {
var comboTruck = $find("<%= cboTruck.ClientID %>");
comboTruck .hideDropDown();
comboTruck .clearSelection();
comboTruck .commitChanges();
var win = $find('<%=dlgTruck.ClientID %>');
win.Close();
return false;
}
</script>
</telerik:RadScriptBlock>
<ccl:WTWindowDialog ID="dlgTruck" runat="server" Width="585px" Height="280px"
Modal="true" Title="ruck" OnClientClose="OnTruckCloseHandler">
<ContentTemplate>
<div style="position: relative;">
<ccl:WTPanel ID="pnlTruckError" runat="server">
</ccl:WTPanel>
</div>
<ccl:WTPanel ID="pnlTruck" runat="server">
<div style="position: relative">
<table cellspacing="2" cellpadding="2" style="width: 100%">
<tr style="height: 15px">
<td>
</td>
</tr>
<tr>
<td class="txtLabelRight" style="width: 84px">
<ccl:WTLabel ID="lblTruck1" Text="Number#:" runat="server" CssClass="txtNormal">
</ccl:WTLabel>
</td>
<td style="width: 130px">
<ccl:WTLabel ID="lblNumberTruck" runat="server" ReadOnly="true" CssClass="txtNormal"
ForeColor="#09417A" Width="130px" TabIndex="1" Height="12px" Font-Bold="false">
</ccl:WTLabel>
</td>
<td class="txtLabelRight" style="width: 140px">
<ccl:WTLabel ID="lblLicense" Text="License Plate:" runat="server" ReadOnly="true"
CssClass="txtNormal">
</ccl:WTLabel>
</td>
<td>
<ccl:WTLabel ID="lblLicenseTruck" ReadOnly="true" runat="server" ForeColor="#09417A"
CssClass="txtNormal" Width="100px" TabIndex="2" Font-Bold="false" Height="12px">
</ccl:WTLabel>
</td>
</tr>
<tr>
<td style="height: 1px">
</td>
</tr>
</table>
<table>
<tr>
<td class="txtLabelRight" style="width: 84px">
<ccl:WTLabel ID="lblDateTruck" runat="server" Text="Date:"></ccl:WTLabel>
</td>
<td>
<ccl:WTDateBox ID="wcDateTruck" runat="server" Width="162px" ToolTip="Deactivate Date"
TabIndex="3">
<DateInput DateFormat="d/M/yyyy">
</DateInput>
</ccl:WTDateBox>
</td>
</tr>
<tr>
<td style="height: 1px">
</td>
</tr>
</table>
<table>
<tr>
<td class="txtLabelRight" style="width: 84px">
<ccl:WTLabel ID="lblTruck" runat="server" Text="Reason:"></ccl:WTLabel>
</td>
<td>
<ccl:WTWebDropDown ID="cboTruck" runat="server" CssClass="txtNormal"
TabIndex="4" Width="162px" AutoPostBack="true" OnSelectedIndexChanged="cboTruck_SelectedIndexChanged">
</ccl:WTWebDropDown>
</td>
<td class="txtLabelRight" style="font-weight: bold; width: 110px">
<ccl:WTLabel ID="lblOtherTruck" runat="server" Text="Other Text:"></ccl:WTLabel>
</td>
<td>
<ccl:WTTextBox ID="txtOtherTruck" runat="server" CssClass="txtNormal" Enabled="false"
Width="160px" TabIndex="5">
</ccl:WTTextBox>
</td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td>
<br />
</td>
</tr>
<tr>
<td style="height: 5px">
</td>
</tr>
<tr>
<td align="right">
<ccl:WTButton ID="btnSubmit" runat="server" CssClass="txtNormal" Font-Size="11px"
Width="70px" Text="Submit" TabIndex="6" OnClick="btnSubmit_Click">
</ccl:WTButton>
</td>
<td style="width: 5px">
</td>
<td>
<ccl:WTButton ID="btnClose" runat="server" CssClass="txtNormal" Font-Size="11px"
Width="70px" Text="Close" TabIndex="7">
</ccl:WTButton>
</td>
</tr>
</table>
</div>
</ccl:WTPanel>
</ContentTemplate>
</ccl:WTWindowDialog>
-------------
.cs file
------------
protected void btnSubmit_Click(object sender, EventArgs e)
{
try
{
this.Master.IsPopUpOpened = true;
this.Master.PopUpPanelId = "pnlTruckError";
this.Master.CurrentWindow = dlgTruck;
//My submit and validations functionality
//PostDetails();
}
catch (Exception oException)
{
}
}
So when i trying to click on submit now at that first time event for submit button has been fired (its working fine).Now we are close that window popup and reopen that popup and click again on Submit functionality submit event is not firing...(Instead of that submit event combobox event has been fired and nothing is happened.) Is there any solution for that..?
Thanks in Advance,
Reagrds,
Subbu
Thanks for reply. Here i have placed my code.. please find that..
---------------------
.aspx
---------------------
<telerik:RadScriptBlock ID="rsb" runat="server">
<script language="JavaScript" type="text/javascript">
function OnTruckCloseHandler(sender, args) {
var comboTruck = $find("<%= cboTruck.ClientID %>");
comboTruck .hideDropDown();
comboTruck .clearSelection();
comboTruck .commitChanges();
var win = $find('<%=dlgTruck.ClientID %>');
win.Close();
return false;
}
</script>
</telerik:RadScriptBlock>
<ccl:WTWindowDialog ID="dlgTruck" runat="server" Width="585px" Height="280px"
Modal="true" Title="ruck" OnClientClose="OnTruckCloseHandler">
<ContentTemplate>
<div style="position: relative;">
<ccl:WTPanel ID="pnlTruckError" runat="server">
</ccl:WTPanel>
</div>
<ccl:WTPanel ID="pnlTruck" runat="server">
<div style="position: relative">
<table cellspacing="2" cellpadding="2" style="width: 100%">
<tr style="height: 15px">
<td>
</td>
</tr>
<tr>
<td class="txtLabelRight" style="width: 84px">
<ccl:WTLabel ID="lblTruck1" Text="Number#:" runat="server" CssClass="txtNormal">
</ccl:WTLabel>
</td>
<td style="width: 130px">
<ccl:WTLabel ID="lblNumberTruck" runat="server" ReadOnly="true" CssClass="txtNormal"
ForeColor="#09417A" Width="130px" TabIndex="1" Height="12px" Font-Bold="false">
</ccl:WTLabel>
</td>
<td class="txtLabelRight" style="width: 140px">
<ccl:WTLabel ID="lblLicense" Text="License Plate:" runat="server" ReadOnly="true"
CssClass="txtNormal">
</ccl:WTLabel>
</td>
<td>
<ccl:WTLabel ID="lblLicenseTruck" ReadOnly="true" runat="server" ForeColor="#09417A"
CssClass="txtNormal" Width="100px" TabIndex="2" Font-Bold="false" Height="12px">
</ccl:WTLabel>
</td>
</tr>
<tr>
<td style="height: 1px">
</td>
</tr>
</table>
<table>
<tr>
<td class="txtLabelRight" style="width: 84px">
<ccl:WTLabel ID="lblDateTruck" runat="server" Text="Date:"></ccl:WTLabel>
</td>
<td>
<ccl:WTDateBox ID="wcDateTruck" runat="server" Width="162px" ToolTip="Deactivate Date"
TabIndex="3">
<DateInput DateFormat="d/M/yyyy">
</DateInput>
</ccl:WTDateBox>
</td>
</tr>
<tr>
<td style="height: 1px">
</td>
</tr>
</table>
<table>
<tr>
<td class="txtLabelRight" style="width: 84px">
<ccl:WTLabel ID="lblTruck" runat="server" Text="Reason:"></ccl:WTLabel>
</td>
<td>
<ccl:WTWebDropDown ID="cboTruck" runat="server" CssClass="txtNormal"
TabIndex="4" Width="162px" AutoPostBack="true" OnSelectedIndexChanged="cboTruck_SelectedIndexChanged">
</ccl:WTWebDropDown>
</td>
<td class="txtLabelRight" style="font-weight: bold; width: 110px">
<ccl:WTLabel ID="lblOtherTruck" runat="server" Text="Other Text:"></ccl:WTLabel>
</td>
<td>
<ccl:WTTextBox ID="txtOtherTruck" runat="server" CssClass="txtNormal" Enabled="false"
Width="160px" TabIndex="5">
</ccl:WTTextBox>
</td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td>
<br />
</td>
</tr>
<tr>
<td style="height: 5px">
</td>
</tr>
<tr>
<td align="right">
<ccl:WTButton ID="btnSubmit" runat="server" CssClass="txtNormal" Font-Size="11px"
Width="70px" Text="Submit" TabIndex="6" OnClick="btnSubmit_Click">
</ccl:WTButton>
</td>
<td style="width: 5px">
</td>
<td>
<ccl:WTButton ID="btnClose" runat="server" CssClass="txtNormal" Font-Size="11px"
Width="70px" Text="Close" TabIndex="7">
</ccl:WTButton>
</td>
</tr>
</table>
</div>
</ccl:WTPanel>
</ContentTemplate>
</ccl:WTWindowDialog>
-------------
.cs file
------------
protected void btnSubmit_Click(object sender, EventArgs e)
{
try
{
this.Master.IsPopUpOpened = true;
this.Master.PopUpPanelId = "pnlTruckError";
this.Master.CurrentWindow = dlgTruck;
//My submit and validations functionality
//PostDetails();
}
catch (Exception oException)
{
}
}
So when i trying to click on submit now at that first time event for submit button has been fired (its working fine).Now we are close that window popup and reopen that popup and click again on Submit functionality submit event is not firing...(Instead of that submit event combobox event has been fired and nothing is happened.) Is there any solution for that..?
Thanks in Advance,
Reagrds,
Subbu
0
Hello Subbu,
Thank you for the code.
We examined it locally, but we are not sure what is the exact problem.
Could you please modify the project I sent you previously, so we can see the problem locally?
What do you mean by the "but internally the event for that respective combobox is not cleared"?
Do you mean that the combobox text is not cleared or the OnSelectedIndexChanged event is not fired?
Please keep in mind that any additional information would be highly appreciated.
Looking forward for your reply.
Regards,
Boyan Dimitrov
the Telerik team
Thank you for the code.
We examined it locally, but we are not sure what is the exact problem.
Could you please modify the project I sent you previously, so we can see the problem locally?
What do you mean by the "but internally the event for that respective combobox is not cleared"?
Do you mean that the combobox text is not cleared or the OnSelectedIndexChanged event is not fired?
Please keep in mind that any additional information would be highly appreciated.
Looking forward for your reply.
Regards,
Boyan Dimitrov
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
subbareddy s
Top achievements
Rank 1
answered on 29 Oct 2012, 12:45 PM
Hi Boyan,
I mean the text has been cleared and at the same time selected index event has been fired as per guessing. is it correct?
Regards,
Subbu
I mean the text has been cleared and at the same time selected index event has been fired as per guessing. is it correct?
Regards,
Subbu
0
Hello Subbu,
Thank you for your reply.
We tried to reproduce the issue that you describe - but without success.
There are only user control definitions in your code, and I am afraid that they do not represent your RadComboBox and RadWindow implementation.
That is why we need your collaboration - could you please provide us the code of one simplified page that contains only RadWindow and RadComboBox? We will use this code to create a clear test case and to reproduce the issue.
What is the exact scenario that you want to implement?
1. Do you want to read the RadComboBox selected item at server-side?
2. Why do you want to clear the selection in RadComboBox while the RadWindow is closed?
Additionally - can you explain in more details how the page represented on the screenshot is intended to work?
The more details you can provide, the better we will be able to help you.
Thank you in advance for your collaboration.
Regards,
Boyan Dimitrov
the Telerik team
Thank you for your reply.
We tried to reproduce the issue that you describe - but without success.
There are only user control definitions in your code, and I am afraid that they do not represent your RadComboBox and RadWindow implementation.
That is why we need your collaboration - could you please provide us the code of one simplified page that contains only RadWindow and RadComboBox? We will use this code to create a clear test case and to reproduce the issue.
What is the exact scenario that you want to implement?
1. Do you want to read the RadComboBox selected item at server-side?
2. Why do you want to clear the selection in RadComboBox while the RadWindow is closed?
Additionally - can you explain in more details how the page represented on the screenshot is intended to work?
The more details you can provide, the better we will be able to help you.
Thank you in advance for your collaboration.
Regards,
Boyan Dimitrov
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
Vipin
Top achievements
Rank 1
answered on 08 Nov 2012, 02:49 PM
I am facing the same issue
u can try this
rcb.trackChanges();
rcb.get_items().getItem(0).select();
rcb.commitChanges()
u can try this
rcb.trackChanges();
rcb.get_items().getItem(0).select();
rcb.commitChanges()
0
Hello Vipin,
Could you elaborate a bit more on the issue that you are facing? The provided information is not sufficient in order to reproduce any issue.
Regards,
Boyan Dimitrov
the Telerik team
Could you elaborate a bit more on the issue that you are facing? The provided information is not sufficient in order to reproduce any issue.
Regards,
Boyan Dimitrov
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
Vipin
Top achievements
Rank 1
answered on 15 Nov 2012, 07:22 AM
HI Dimitrov,
I was facing the similar kind of issue and I found the solution and I Shared the Solution in previous Post . So I am sharing it again nothing to Elaborate much in this.
The Issue was that when I am Using the Java script function to clear the Rad Combo Box. the Control Still hold some value.
The That three line of code help me to achieve my goal.
I used this code You just need to get the value of rad combobox control
in java script function and then use this :
rcb.trackChanges();
rcb.get_items().getItem(0).select();
rcb.commitChanges()
Regards :
Vipin Joshi
I was facing the similar kind of issue and I found the solution and I Shared the Solution in previous Post . So I am sharing it again nothing to Elaborate much in this.
The Issue was that when I am Using the Java script function to clear the Rad Combo Box. the Control Still hold some value.
The That three line of code help me to achieve my goal.
I used this code You just need to get the value of rad combobox control
in java script function and then use this :
rcb.trackChanges();
rcb.get_items().getItem(0).select();
rcb.commitChanges()
Regards :
Vipin Joshi