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

RadConfrim Return false

5 Answers 67 Views
Forum suggestions
This is a migrated thread and some comments may be shown as answers.
Yvette
Top achievements
Rank 1
Yvette asked on 22 May 2009, 04:33 PM
 I am fighting with an  issue.  Putting return false in the Button(Btnsubmit) will stop the page from posting-back so the cb function can be called, however it will still not give the desired result of posting back if the user clicks the OK in the radconfirm window.

The flow the OP and I are trying to achieve is this:

1) user clicks a Submit button
2) radconfirm window comes up with ok and cancel
3) user clicks OK
4) on button onclick event i am trying to insert values into database and mail it to the manager
5)on button ONCLIENTCLICK i call radconfrim as

 

OnClientClick ="radconfirm('Request Submitted',confirmCallBackFn,330,100,'Confirmation!');return false;"

 

 


with javascript

function

 

confirmCallBackFn(arg) {

 

 

 

if(arg)

 

window.location =

 

"ViewList.aspx"

 

 

}


This does not work.... if i say return false along radconfrim the ,poup opens on clicking the submit button and when i hit ok it returns to the desired page but the mail is not getting send which shld get triggerd by ONCLICK.

Alias when i say the radconfirm wihtout the return false,the popup vanishes even befor i could click ok and goes to the page and as well as sends the mail.How to make it work.

Any suggestions appreicated.
Yvette

5 Answers, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 25 May 2009, 11:24 AM
Hello Yvette,

In order to get the desired result, you should call the built in javascript function __doPostBack when you want the postback to take place. You can find more information about it below:

http://geekswithblogs.net/mnf/archive/2005/11/04/59081.aspx

Greetings,
Svetlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Yvette
Top achievements
Rank 1
answered on 25 May 2009, 01:23 PM
Many thanks for your respond.I have already solved the issue.
yvette
0
Yvette
Top achievements
Rank 1
answered on 25 Nov 2009, 04:19 PM

Hi

Thanks for you reply.I have another problem here and im in a need of quick solution.
Well i have two grids.on clicking the row of grid one the grid teo should get updated based on the Id of the row i clicked and fill in values for grid 2. Im using radajaxmanager here along with 
ajaxRequestWithTarget  and i call the Raisepostpostback from the server side.
The problem is whenever  i click the row of radgrid1,the selecteditems.count of radgrid1 is always 0 and thereby the radgrid1.selectedvalue is always 0 ,so my second radgrid2 do not even get updated.

Here is my code snippet :

 

function RowSelected(sender,args)  // call this fun from clientevents on rowselection. 

{

 

 

var grid = sender;

 

 

var MasterTable = grid.get_masterTableView();

 

 

var row = MasterTable.get_dataItems()[args.get_itemIndexHierarchical()];

 

 

var cell = MasterTable.getCellByColumnUniqueName(row, "TransactionID");

 

 

var ID = cell.innerHTML;

 

alert (ID);

 

var ajaxmanager = $find("<%= RadAjaxManager1.ClientID %>");

 

ajaxmanager. ajaxRequestWithTarget(

"<%=InvoiceTransactionGrid.UniqueID %>","RowSelectionChanged:" + ID);

 

 

telerik

 

:RadAjaxManager ID="RadAjaxManager1" runat="server" EnableAJAX ="true" >

 

 

<AjaxSettings>

 

 

<telerik:AjaxSetting AjaxControlID="InvoiceTransactionGrid">

 

 

<UpdatedControls>

 

 

 

<telerik:AjaxUpdatedControl ControlID="InvoiceTransactionGrid" /> //radgrid1

 

 

<telerik:AjaxUpdatedControl ControlID="InvoiceTransactionDetailGrid" LoadingPanelID ="AjaxLoadingPanel1" /> //radgrid2

 

 

</UpdatedControls>

 

 

</telerik:AjaxSetting>

 

 

 

</AjaxSettings>

 

</

 

telerik:RadAjaxManager>

 

 

 

 

 

 

 

<telerik:RadAjaxLoadingPanel ID="AjaxLoadingPanel1" runat="server" Transparency="20" BackColor="#E0E0E0">

 

 

<table style="width:100%;height:100%;">

 

 

<tr style="height:100%">

 

 

<td align="center" valign="middle" style="width:100%">

 

 

<img src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading4.gif") %>'

 

 

alt="Loading..." style="border: 0;"/>

 

 

</td>

 

 

</tr>

 

 

</table>

 

 

</telerik:RadAjaxLoadingPanel>

 

 

 


 

 

 

<telerik:RadGrid ID="InvoiceTransactionGrid" runat="server" Skin="Web20" Width="99.5%"

 

 

AllowSorting="True" AllowFilteringByColumn="true" AllowMultiRowSelection ="false"

 

 

PageSize="15" PagerStyle-Mode="NextPrevNumericAndAdvanced"

 

 

ShowFooter="True" AllowPaging="True" AutoGenerateColumns="False"

 

 

OnNeedDataSource="InvoiceTransactionGrid_NeedDataSource">

 

 

<MasterTableView TableLayout="Auto" Width="100%" EditMode="EditForms" CommandItemDisplay="Bottom"

 

 

ClientDataKeyNames="ID">

 

 

 

 

 

 

<telerik:RadGrid ID="InvoiceTransactionDetailGrid" runat="server" Skin="Web20" Width="99.5%"

 

 

AutoGenerateColumns="False" AllowAutomaticUpdates="False" AllowAutomaticDeletes="False"

 

 

AllowAutomaticInserts="False" AllowMultiRowEdit="False" OnNeedDataSource="InvoiceTransactionDetailGrid_NeedDataSource"

 

 

OnPreRender="InvoiceTransactionDetailGrid_PreRender" OnItemDataBound="InvoiceTransactionDetailGrid_ItemDataBound"

 

 

ShowHeader="false" Style="overflow: hidden;">

 

 

<MasterTableView ClientDataKeyNames="ID" ShowHeader="false" CommandItemDisplay="Bottom"

 

 

Width="100%">

 

 

 


my server side code is :

 

 

protected override void RaisePostBackEvent(System.Web.UI.IPostBackEventHandler sourceControl, string eventArgument)

 

{

 

base.RaisePostBackEvent(sourceControl, eventArgument);

 

 

 

if (sourceControl is RadGrid)

 

{

 

string[] eventArgs = eventArgument.Split(':');

 

 

switch (eventArgs[0])

 

{

 

case "RowSelectionChanged":

 

InvoiceTransactionDetailGrid.Rebind();

 

break;

 

 

case "RefreshMainGrid":

 

InvoiceTransactionGrid.Rebind();

 

break;

 

 

case "DeleteTransaction":

 

 

GridDataItem selectedItem = (GridDataItem)InvoiceTransactionGrid.SelectedItems[0];

 

 

int transactionID = Convert.ToInt32(selectedItem["TransactionID"].Text);

 

m_monthlyBillEditDataAccess.DeleteInvoiceTransactionAndBillingHistory(transactionID);

InvoiceTransactionGrid.Rebind();

 

break;

 

 

default:

 

 

break;

 

}

}

}

 


 

 

 

protected void InvoiceTransactionDetailGrid_NeedDataSource(object source, GridNeedDataSourceEventArgs e)

 

{

 

int selectedTransactionID = 0;

 

 

int num = InvoiceTransactionGrid.SelectedItems.Count ;

 

 

if(InvoiceTransactionGrid.SelectedItems.Count>0) // this is always zero

 

{

 

selectedTransactionID = (

int)InvoiceTransactionGrid.SelectedValue; //always zero

 

TransactID = selectedTransactionID;

 

 

}

 

else if(InvoiceTransactionGrid.Items.Count > 0)

 

{

selectedTransactionID = (

int)InvoiceTransactionGrid.Items[0].GetDataKeyValue("ID"); // i get the top most item always on page load

 

 

}

 

MonthlyBillEditDataAccessSet dataset = m_monthlyBillEditDataAccess.GetInvoiceTransactions(selectedTransactionID);

 

InvoiceTransactionDetailGrid.DataSource = dataset.InvoiceTransactionsCarrierInfoJoinView;

}

 

Can you please explain whats wrong and how am i supposed to overcome with it .Provide some code examples,i have read enough documents and i totally frustrated without having to find anything.
I appreciate your help.

Thanks
Yvette

0
Sebastian
Telerik team
answered on 26 Nov 2009, 08:17 AM
Hello Yvette,

I already answered your inquiry in the other forum thread you took part in:

http://www.telerik.com/community/forums/aspnet-ajax/ajax/ajax-extender-and-radgrid-refresh-using-javascript-two-component-same-id-problem.aspx

Please post your questions in the respective product forum - thus the Telerik Support Staff from the corresponding product team can easily keep track of your support history and provide appropriate answers.

Regards,
Sebastian
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
janupagla khan
Top achievements
Rank 1
answered on 07 Dec 2009, 06:49 AM
In the RequestStart() function, if a request is in-process, then simply return false to cancel the new request. If there is no request currently processing.


thanks

Tags
Forum suggestions
Asked by
Yvette
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Yvette
Top achievements
Rank 1
Sebastian
Telerik team
janupagla khan
Top achievements
Rank 1
Share this question
or