[CLOSED] ToScript() requires HttpContext

  1. #1

    [CLOSED] ToScript() requires HttpContext



    I'm calling a WCF service with an Ajax request. Inside the service I'm generating a window with a formPanel and some custom fields, then calling ToScript() and returning the script to the client.

    One of my the Fields is a TriggerField, and when I call ToScript(), the following code fails because there is no HttpContext to get the ResourceManager from.

    Please tell me there is a way around this?

    protected static void RegisterTriggerIcon(TriggerIcon icon, bool force)
    {
      if (icon == TriggerIcon.Combo || 
          icon == TriggerIcon.Clear ||
          icon == TriggerIcon.Date ||
          icon == TriggerIcon.Search)
       {
         return;
       }
    
    
       ResourceManager rm = ResourceManager.GetInstance(HttpContext.Current);
       .
       .
       .
    }
  2. #2

    RE: [CLOSED] ToScript() requires HttpContext



    I didn't see anyway around this so I refactored out the WCF service and am not using the ToScript() method anymore. Too bad, I thought that pattern would be very usefull.

    I see what the code was doing and why (finding and tweeking the ResourceManager), but having this buried in the script generation process really limits the use of the ToScript() capabalities.
  3. #3

    RE: [CLOSED] ToScript() requires HttpContext

    Hi,

    We have fixed it. Now exception doesn't occur but you have to register trigger icons manually in the page
    TriggerFieldBase.RegisterTriggerIcon(TriggerIcon.SimpleAdd);

Similar Threads

  1. Winow.ToBuilder().ToScript()
    By arit in forum 1.x Help
    Replies: 1
    Last Post: Jun 24, 2011, 1:32 PM
  2. [CLOSED] Problem with HttpContext.Server.Transfer
    By xeo4.it in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jan 14, 2011, 2:52 PM
  3. [CLOSED] Bug with .ToScript() for ComponentMenuItem
    By pil0t in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: May 05, 2010, 4:25 PM
  4. Replies: 1
    Last Post: May 19, 2009, 7:30 AM
  5. Replies: 2
    Last Post: Apr 24, 2009, 6:07 PM

Posting Permissions