iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Gentlemen,
Webscheduler does not refresh timeline resource list when command scheduler.Refresh() - for example;
var controlId = $('#ControlBoardId').val(); var scheduler = ISGetObject(controlId); scheduler.Refresh();
It seems to refresh the actual data, however the resource list does not refresh, and therefore the data is not displayed. We can only get the resources to refresh if we refresh our entire page.
Any insight you could provide would be greatly appreciated.
Thanks - Frank
WebScheduler has RefreshResources() method which will refresh all resources.
var scheduler = ISGetObject(controlId); scheduler.RefreshResources();
Hope this helps.
Hi Yudi -
Thanks for the prompt reply.
We just tried using scheduler.RefreshResources(); but it doesn't do anything like with scheduler.Refresh() it do make a server side request. Do we need to have a code behind or client side event some thing like that to get it woking. Below is code snippet :
var controlId = $('#ControlBoardId').val();
var scheduler = ISGetObject(controlId);
scheduler.Refresh();
scheduler.RefreshResources();
If you can provide a working example it would be of great help.
I made a minor modification to the ShowHideResourcesAPI.aspx sample file of WebScheduler. An HTML button is added. Clicking this button will invoke following JS function.
function ChangeUpdateResources() { var WebScheduler1 = ISGetObject("WebScheduler1"); var resources = WebScheduler1.Resources; resources[0].ResourceName = "Modified Resource"; WebScheduler1.RefreshResources(); return true; }
ChangeUpdateResources() function will modify resource with index 0, which equals to Tracy, by replacing the ResourceName to “Modified Resource”. Next, RefreshResources() method is called to apply the changes.
I’m using WebScheduler 4 build 4. Should you have different result, please feel free to let me know.
We tried this code yudi but somehow it didn't work for us. Attached in the reply is a video (2014-06-19_1527_RefreshResources_NW) showing how "RefreshResources()" function didn't update the "ResourceName" but a "Refresh()" do update the "ResourceName" but thats one thing ,the major issue is we don't want just the resource names to be updated but we want the interface to load all the resources of the selected company from the dropdown so that the data is visible on the webscheduler control board. Right now whats happening is it loads the right data for the selected company resources but since the resources are not updated on the interface the data does not get plotted.
For better explanation of the above problem please refer to attach video (2014-06-19_1539_PageRefreshWork).In this video you can see we have a company dropdown on the page and on its change we have a jquery event which make a ajax call to a handler to update the session variable for the selected company (context.Session["WebScheduler.ViewSettings.SelectedCompany"]) and once it does that we call Scheduler.Refresh() function . When we call refresh for scheduler call the "ISDataSource1_Selecting" event to re-bind the data and resources depending upon any change which in our case should load data and resources for the changed company. You can see that it hit the breakpoint in code (e.ViewName == "Nop_Resource") and pass the selected company id as parameter since to load resource we are using a StoredProcedure. Every things look ok but as soon the call retuned back to the page we can see the resources were unchanged and no data is visible since data is updated but not the resources so new data didn't get plotted. Further you can see if we do a complete page refresh on the selection of company from dropdown every thing work fine.
This is really getting complicated now because we can't refresh the whole page since by doing that user will loose their current state of page and we really don't want that and because of this problem we are not able to release this code.
Hope we can expedite this issue and get it resolved ASAP.
I enclosed one simple sample of WebScheduler based on your description. A WebCombo, WebCombo1, is added into the page. It shows list of Resources.
WebScheduler displays its events based on the selected value of WebCombo1. When user changes the selection, the Timeline’s Resource refresh and shows the selection respectively.
Please have the attached sample evaluated on your end and let us know whether it helps or not.
We tried to run your sample to have more accurate evaluation over its working but it didn't work for us. We added all the required assemblies and though it build fine when we run it , it throws error "JavaScript runtime error: 'InitWC40' is undefined". So we manually compare the implementation and below mentioned are the findings in the 2 implementation :
1) We are using a ASP dropdownlist where as your sample use Webcombo , though we are not sure if that would matter or will it ?
2) In the select command of Adapter your sample is using a "asp:SessionParameter" where as our implementation use "asp:Parameter". As per this also we are not sure if this change would matter .
3) Finally IsDatasource1_Selecting event is called to refresh resources with the right parameter value passed , which is same what we have in our implementation and this is what we think matters.
Other than the above mentioned points we don't find any other point which we think is missing from our implementation and because of which it is happening so we are providing you our sample code (Reservations_WebschedulerDetail_sample)which we are using and hopefully you can let us know what is wrong with the code. Also we are attaching you sample code with our modification which didn't work for us.
Looking forward for a quick response.
I was unable to open/extract the RefreshTimelineResources_modified.zip file. So I decided to modify my sample based on the following information.
...1) We are using a ASP dropdownlist where as your sample use Webcombo , though we are not sure if that would matter or will it ?2) In the select command of Adapter your sample is using a "asp:SessionParameter" where as our implementation use "asp:Parameter". As per this also we are not sure if this change would matter ....
Please have the modified sample evaluated on your end and let us know whether it helps or not.
Ok, so this time we were able to run your sample and it is working but that's not how we were looking forward to it to work. If you read our previous replies you can see that we were able to get the resources and latest data updated on the webscheduler if we do a page refresh (or a POSTBACK to server) but we can't do that because we need to preserve the state of page and as we can see in your modified page code that you are doing a POSTBACK on value change of the dropdown and that's how it is working in your sample.
We have modified you sample with some of our modified code and attaching those for your refrence ('ModifiedFiles_AndHandler') that how we trying to get it work without POSTBACK or page refresh.If you unzip the attached zip folder you can find two of your own modified files and one folder where we have added a Handler to update the Session variable 'resourceid'.Below mentioned are the changes we made to your code to make it look alike as per our current code.
> 'WSUsingSessionInSelectMethod_Modified.aspx' : AutoPostBack is set to 'False' for Dropdown so there is no page reload.
> 'WSUsingSessionInSelectMethod_Modified.aspx' : Attached a Javascript code on 'Change' event of dropdown to update the Session variable 'ResourceID' with the help of a Handler ('ControlBoard_UpdateSessionVariable') and then calling 'Webscheduler.Refresh()'. Note :* You need to include Javascript library file in your code.
> 'WSUsingSessionInSelectMethod_Modified.aspx.cs' : Modified your 'ISDataSource1_Selecting' event to pass Session["ResourceID"] value to e.InputParameters["ID"] instead of DropDownList1.SelectedValue.ToString(); since dropdown no longer posting value back to server.
After making the above mentioned changes we found that 'Webscheduler.Refresh()' and 'Webscheduler.RefreshResources()' they both don't update the webscheduler until and unless the Page is refreshed in your sample also even though the input parameter value is right.
Hope you can have a better understanding of our problem now and may you just let us know whether it is possible to refresh resources on the page without doing a postback or pageload by using control client side event webscheduler.Refresh() or webscheduler.RefreshResources().
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname