ServerResourcesPopulating client event

8 posts, 0 answers
  1. Mark Rabjohn
    Mark Rabjohn avatar
    23 posts
    Member since:
    Jan 2010

    Posted 05 Jul 2010 Link to this post

    Hi,

    I am using the RadScheduler in a project, which populates using Web Services. Most of my web service functions accept a "schedulerInfo" parameter, which is very useful for dynamically selecting items to display.

    Effectively on my client, I use:

    function schedulerPopulating(sender, eventArgs) {
        var s = eventArgs.get_schedulerInfo();
        s.EngineerID = $("input[id$=_EngineerID]").val();
    }

    Which is triggered by the OnClientAppointmentsPopulating="schedulerPopulating" attribute of the RadScheduler.

    Clearly I use this to pass the ID of my engineer so that he only sees his jobs on the screen.

    The problem is, that although GetResources gets called, I can't work out how to pass my VisibleStart/VisibleEnd and EngineerID to the GetResources web service function. "OnClientResourcesPopulating" would appear to be appropriate, and when I have changed the population mode to Client, this does work, and I can pass my own variables, although other stuff doesn't work (grouping by resource).

    How can I get this callback to work AND group by resources using a timeline view AND web services?

    Alternatively, how can I get the Visible date range and my custom parameters to pass in to the getResources command? Can I hook the call in any other way?

    Thanks in advance for your help.


  2. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 12 Jul 2010 Link to this post

    Hi Mark,

    This is a common scenario and it has been discussed in details in this forum thread. Please, review it and let us know if you have further questions.



    Kind regards,
    Peter
    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Mark Rabjohn
    Mark Rabjohn avatar
    23 posts
    Member since:
    Jan 2010

    Posted 12 Jul 2010 Link to this post

    Hi Peter,

    I have read that thread, and have implemented those suggestions - indeed I clearly state that I have done that in my original posting.


    The problem is to do with "Resources" - there is a "ResourcesPopulating" client-side event that does the same thing as the one for appointments, but it doesn't get called when the Scheduler is bound to the server.

    If it doesn't get called, then I can't pass my parameters to my get resources event.

    The question is, how can I have my scheduler bound to the server, AND pass parameters to my GetResources method?

    Mark
  5. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 16 Jul 2010 Link to this post

    Hi Mark Rabjohn,

    Currently, RadScheduler doesn't provide integrated mechanism to pass additional parameters to the GetResources method. For the moment you can use either the Session or page properties to pass additional information to the provider.

    Greetings,
    Peter
    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
  6. Mark Rabjohn
    Mark Rabjohn avatar
    23 posts
    Member since:
    Jan 2010

    Posted 19 Jul 2010 Link to this post

    Hi Peter,

    My client has now purchased the Components with Source code, I would presume that I can now compile my own Telerik libraries although I haven't checked yet. Is there an easy way to ensure that the event gets called via editing the source code? i.e. have the scheduler control call the client side event, but still bind resources at the server end.

    Alternatively, and I know that this is not a Telerik question, but how do I get Sessions to work with my WCF web service - I'm not too familiar with WCF, and when I switch my binding to wsHttpBinding, the service does not work - I surmise that this is something to do with SSL certificates, but I need to test without certificate etc.

    Thanks for your help.

    Mark
  7. Mark Rabjohn
    Mark Rabjohn avatar
    23 posts
    Member since:
    Jan 2010

    Posted 20 Jul 2010 Link to this post

    Hi Peter,

    I've worked out that the WCF binding that I should be using is webHttpBinding because it can do plain xml and json, I have also verified that my session object is working in this scenario, however it is not possible to pass parameters to the web service via the session object.

    I feel that I should illustrate my problem further, the progress is as follows:

    1) My web form loads
    2) The RadScheduler calls internally GetResources at the server side.
    3) GetResources doesn't receive custom parameters, nor does it receive standard parameters.

    Problem: I need my custom parameters, plus I need the Visible Start Date and Visible End Date parameters, none of which is passed.


    You have suggested that I could use the session object to pass the data - however the first call to GetResources is executed on the server side, using your web client object, which uses a different session ID every time i.e. at that call, my session ID does not match up with the web site!

    You have suggested that I could set properties on the page, however my session object is not lined up, so I can not get to these variables from my web service - no session - no page reference.


    The documentation suggests that if I bind resources on the client side, that I can't utilise web-bound timeline view with group by, which the entire application depends upon. I have verified that if I bind client side, I don't get any resources displayed.

    We really need to get custom parameters and the visible window passed to the initial GetResources call - how can this be made possible?

    Mark
  8. Mark Rabjohn
    Mark Rabjohn avatar
    23 posts
    Member since:
    Jan 2010

    Posted 20 Jul 2010 Link to this post

    Peter,

    I could effect a workaround if the RadScheduler had customisable data items and the schedulerInfo parameter of the webservice callback would return them in a collection (similar to the Attributes collection of Resources). Basically I could create my own temporal session structure based upon the actual session id keys.

    Without identifying information from the web browser or RadControl, I'm afraid that this is unsolvable.

    Would it be possible to add such a feature? i.e. a "UserAttributes" collection that passes through the schedulerInfo parameter.

    Mark
  9. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 22 Jul 2010 Link to this post

    Hi Mark,

    Please, review this help topic, section on "Passing additional arguments to the GetResources method when using server-side mode"

    And for the other question, see the forum thread on Sending extra info to the web service.

    I hope this helps.

    Kind regards,
    Peter
    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
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017