Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vue.js/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jquery-ui/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何禁用Sitecore WFFM自定义字段缓存_Sitecore_Sitecore6_Web Forms For Marketers - Fatal编程技术网

如何禁用Sitecore WFFM自定义字段缓存

如何禁用Sitecore WFFM自定义字段缓存,sitecore,sitecore6,web-forms-for-marketers,Sitecore,Sitecore6,Web Forms For Marketers,我在Sitecore WFFM中有一个自定义字段SomeCustomFieldType,它在表单编辑器的左侧显示一个属性,该属性是一个带有选项列表的下拉列表 [视觉属性选择值,99, VisualCategoryCustom属性, VisualFieldTypeOfCountryBasedListChoiceField] 公共字符串ChosenValue{get;set;} 我没有使用开箱即用的ListChoiceField,而是编写了我自己的CountryBasedListChoiceFiel

我在Sitecore WFFM中有一个自定义字段SomeCustomFieldType,它在表单编辑器的左侧显示一个属性,该属性是一个带有选项列表的下拉列表

[视觉属性选择值,99, VisualCategoryCustom属性, VisualFieldTypeOfCountryBasedListChoiceField] 公共字符串ChosenValue{get;set;} 我没有使用开箱即用的ListChoiceField,而是编写了我自己的CountryBasedListChoiceField,它根据一些条件,计算出哪些选项需要显示在属性下拉列表中:

以国家为基础的公共物流场 :baseobject HtmlTextWriterTag.Select.ToString { 字符串formID=Sitecore.Context.Request.GetQueryStringformid; Language formLanguage=Language.ParseSitecore.Context.Request.GetQueryStringla; Item formItem=Sitecore.Context.ContentDatabase.GetItemformID,formLanguage; 字符串countryName=SitecoreUtility.GetCurrentCountryISOCodeformItem,formLanguage; 字符串choicesRootPath=CountryConfigurationManager.GetCountrySitecountryName.Metadata.FormsStylesheetsItemPath; Item choicesRootItem=Sitecore.Context.ContentDatabase.GetItemchoicesRootPath,formLanguage; ChoicesRoot=choicesRootItem.ID.ToString; } 上面的代码如何工作并不重要,因为它工作得很好

我遇到的问题是,上面的代码只执行一次,这是用户第一次在表单编辑器中打开表单并单击SomeCustomFieldType类型的字段

之后,必须缓存要显示的选项列表,因为此代码再也不会被命中。即使关闭浏览器并重新打开它也不足以清除该缓存-iisreset显然会清除该缓存

我想知道是否有办法阻止这种缓存的发生


提前谢谢

首先,您应该检查以确保未在此处缓存渲染:“/sitecore/layout/Renderings/Modules/Web Forms for Marketers/Form”WFFM的版本我现在已经打开,它不是默认版本。还要检查以确保它所包含的任何渲染也不会被缓存


查看表单代码,每次都会构造表单项和字段容器。我还检查了调用的.ascx,它没有默认的输出缓存。您可以从类“Sitecore.Form.Web.UI.Controls.SitecoreSimpleFormAscx”的Sitecore.Forms.Core.dll中深入查看开始,但我会先尝试简单的方法

@maras musielak感谢您的编辑!我认为,缓存对所有VisualProperty都是全局性的。它与特定的形式无关。CountryBasedListChoiceField的构造函数只被调用一次,这是在应用程序重新启动后第一次打开包含该类型字段的窗体。