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

Call FormView - AjaxRequest after RadWindow loading

3 Answers 85 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
archimede
Top achievements
Rank 1
archimede asked on 12 Oct 2010, 01:45 PM
Hi,
I need to know where call  and ajaxRequest in a particolar scenario:

When i click in ContexMenu of a RadTreeView i open a radwindow that receives some arguments from the RadTreeView .
On the radwindow i have two hiddenfields and a radajaxpanel that contains a formview.
I Get the args on the rad window with this javascript function

function
pageLoad() {txtInputIdLinea = document.getElementById('hdfIdLinea');

 

 

 

var currentWindow = GetRadWindow();

 

txtInputIdLinea.value = currentWindow.argument.Idlinea;}

 

 

The datasource of the formview has hdfIdLinea as a parameter.

The problem is that when the radwindow finish "loading" the formview didn't see the value set in hdfIdLinea, so  after setting the value i add an ajax Request like this
$find(

 

"<%= Panel.ClientID %>").ajaxRequest("Update panel");

And It works, but this code run in a loop and i have this exception
Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed.

May you help me?. I need to force a postback of the FormView once time after the radwindow is loaded.
thanks._

 

3 Answers, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 15 Oct 2010, 11:50 AM
Hi,

I would suggest you to use the ajaxRequestWithTarget function. By using it you could directly set target control for the Ajax request. Note that the target control is the control which should raise postback event and you should always use the control's UniqueID. Please refer to the following help topic which elaborates on this matter.




Regards,
Maria Ilieva
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
archimede
Top achievements
Rank 1
answered on 19 Oct 2010, 01:28 PM
Hi Maria,
The problem is that the formview is on a RadWindow so when i receive the args it's too late because de formview didnt' see the info that i put in ('hdfIdLinea')  so the databind it's done with a value of '0' , so if i do a postback the formview has the right information.
The problem is where i can do this post back to execute it ONLY ONE TIME and when the page is loaded,
 I try on the javascript  of the radwindow but it gone in a loop.

 

 

 

function pageLoad() {
     
     
    txtInputIdLinea = document.getElementById('hdfIdLinea');             
    var currentWindow = GetRadWindow();
    txtInputIdLinea.value = currentWindow.argument.Idlinea;
    var ajaxManager = $find("<%= RadAjaxManagerLinee.ClientID %>");
    ajaxManager.ajaxRequestWithTarget('<%= frvLinea.UniqueID %>', '');
                
}
<telerik:RadAjaxManager ID="RadAjaxManagerLinee" runat="server">
       <AjaxSettings>
           <telerik:AjaxSetting AjaxControlID="hdfIdLinea">
               <UpdatedControls>
                   <telerik:AjaxUpdatedControl ControlID="frvLinea" />
               </UpdatedControls>
           </telerik:AjaxSetting>
       </AjaxSettings>
   </telerik:RadAjaxManager>
      
    <asp:FormView ID="frvLinea"  runat="server" DataSourceID="ODSLinee" >
      
        <EditItemTemplate>

Thanks !!
0
Maria Ilieva
Telerik team
answered on 25 Oct 2010, 08:46 AM
Hello,

Thank you for getting back to us.

Could you please open a regular support ticket and send us sample fully runnable application which demonstrates the described issue. Thus we will be able to correctly understand your scenario and do our best to provide a proper solution.


Greetings,
Maria Ilieva
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Ajax
Asked by
archimede
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
archimede
Top achievements
Rank 1
Share this question
or