All times are UTC + 2 hours [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
  Print view

How to stop async script on Value Change of text box control
Author Message
PostPosted: Thu Dec 04, 2014 12:08 pm 
Offline

Joined: Wed Sep 25, 2013 6:22 am
Posts: 107
hi,

I have used text box control. On Value Change scripts, I have used Form.LoadListQuery function.

So, how to I start and stop async for this

Thank you so much


Top
 Profile  
 

Re: How to stop async script on Value Change of text box con
PostPosted: Sun Dec 07, 2014 1:49 am 
Offline

Joined: Tue Mar 08, 2011 7:37 pm
Posts: 275
Sorry the requirement is not very clear.
What do you mean startp/stop async? Please provide an example

_________________
Spyros Moschovakos

Best Practice Consulting,
http://www.bpc-components.com


Top
 Profile  
 

Re: How to stop async script on Value Change of text box con
PostPosted: Thu Dec 18, 2014 4:56 am 
Offline

Joined: Wed Sep 25, 2013 6:22 am
Posts: 107
Hi,

When form loaded, I want to get data from list item by list query

form.LoadListQuery("GetListItemById", function(e){
if (pf.IsEmpty(e.ErrorMessage)){
var namevalue = e.ListItems[i].NameValue;
form.GetControl("c_Textbox").SetValue(namevalue);
}
else{
alert("Error : " + e.ErrorMessage);
}
});

I need start/stop async to make sure c_Textbox that got value from list query?

If yes, please help me, how can I do it?

Thanks


Top
 Profile  
 

Re: How to stop async script on Value Change of text box con
PostPosted: Fri Dec 19, 2014 7:06 pm 
Offline

Joined: Tue Mar 08, 2011 7:37 pm
Posts: 275
if I understood well, you want to resume the Form Load Completed event async execution. This is done by calling the form.OnLoadCompleted() method.

I quote the instructions mentioned in the designer:
Quote:
If 'Asynchronous execution' is selected, the script should call the form.OnLoadCompleted() method.
This may be used when asynchronous methods must be called during the loading of the form
In the following example, we load the details of the author of the current record and apply values from the list item to a form control :
Code:
var id = "";
if (!IsNullOrEmpty(form.DataItem.Author)) id = GetValueFromLookup(form.DataItem.Author);
form.LoadRecord("http://wssdev1", "User Information List", id, function(e)
  {
    if (!IsNullOrEmpty(e.ErrorMessage)) alert(e.ErrorMessage);
    else form.GetControl("c_AuthorLoginName").SetValue(e.ListItem.Name);
    form.OnLoadCompleted();
});


_________________
Spyros Moschovakos

Best Practice Consulting,
http://www.bpc-components.com


Top
 Profile  
 

Re: How to stop async script on Value Change of text box con
PostPosted: Mon Aug 31, 2015 5:25 am 
Offline

Joined: Wed Sep 25, 2013 6:22 am
Posts: 107
Thank you so much


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC + 2 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Style by custom web design , optymalizacja pozycjonowanie strony pozycjonowanie
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group