function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ahsensahsens 

Cannot include one S-Control in another in Winter 07 release

Hi,

 

I have developed an s-control (say its name is "Common") which has some functions. I am including this S-control in my other scontrols and i call the function written in "Common". Every thing was working fine till this morning when sandbox was upgraded to Winter 07 release. Now when i try to execute any s-control which include "Common" s-control there is some error. I just want to know how can i fix this. I want to keep these common function saperate so that i have a single s-control in which i can maintain their code.  

 

If i copy the code in "Common" into the other S-control where I have to use their function, then the s-control run correctly, but it is not including the s-control. i have tried to search for an alternative but could not find one.

 

Please let me know if with the release of the Winter 07, we have to change and update our s-control, or this issue can be fixed with out the need to change a lot of s-controls.

 

a quick response will be appreciated

 

 

Doug ChasmanDoug Chasman
What mechanism were you using to include one scontrol into another one prior to Winter '07 (I expect this was via <script src="your scontrol's url here"></script>)?

We have formailized the ability to include a an scontrol "snippet" in '07 with the new scontrol function INCLUDE(). You can switch to using this new function which is the preferred method and has some other advantages. To switch edit "Common" to add a <script></script> tag around your javascript and change the scontrol's type to Snippet.

Then in your scontrols that are including Common replace <script src="url to Common"></script> with:
{! include($Scontroll.Common) }
I see what the problem is with the <script> approach and have opened a bug to fix this to supply backward compatability asap (the fix for this is ready and should be included in the our Thursday patch release).

Message Edited by Doug Chasman on 12-11-2006 11:53 AM

ahsensahsens

Hi Doug,

 

     Thanks for a quick reply. You are right, i was using <script src="your s-control's url here"></script> to include the "Common" S-control in my other S-controls. I have tried to include the "Common" s-control the way you told and It is working correctly.

 

     As you have mentioned that the fix for including the S-control using <script src="your s-control's url here"></script> is ready, I just want to make sure that with this fix, all my s-controls which are including "Common" s-control using script tag will work correctly without the need to update them. And with this fix, do I still have to put the script tag around my "Common" s-control's JavaScript and make its type to "Snippet"? In other words, what minimum changes, if there are any, do I have to make to include the s-control using script tag, so that i don't have to update a lot of s-controls.

michaelforcemichaelforce

Doug (or anyone out there!),

Is this also how you would include an html or js file which is in the documents tab?

Ron HessRon Hess
i don't think there is a merge field for including documents into scontrols.
Rather, the snippet should be used for all these type of "include" files.