coldfusion nested custom tag 使用方法

出现 Property or method “xx“ is not defined on the instance but referenced during render 解决方法(全面分析) 出现 Property or method "xx" is not defined on the instance but referenced during render 解决方法(全面分析) 阅读详情

 

这个链接可以很明确的说明nested custom tag如何使用,举出了例子,相当好!

http://www.bennadel.com/blog/293-ColdFusion-Basics-Nesting-Custom-Tags.htm

 

下面把这个例子的源代码区分的发出来,可以学习一下,看了你就很明白的。

按照顺序

需要先来看item.cfm文件

 

<!--- Kill extra output. --->
<cfsilent>
 
 <!---
  We only want to associate tag info with the parent in the
  first run of the sub tag. Otherwise, we might end up
  storing the info twice. Also, no need to validate
  attributes twice, the first time is sufficient.
 --->
 <cfif (THISTAG.ExecutionMode EQ "Start")>
 
  <!---
   Associate this tag with the parent tag. We are
   going to override the default value for data
   collection. It is usually AssocAttribs, which is a
   horrible name. We are going to store it in the
   structure "Items". This will allow the attribute data
   of the tag to be stored in parent tag.
 
   In this case, "list.cfm" is our parent tag. We define
   this association via the old school name "cf_list".
  --->
  <cfassociate
   basetag="cf_list"
   datacollection="Items"
   />
 
  <!--- Param tag attributes. --->
  <cfparam
   name="ATTRIBUTES.value"
   type="string"
   default=""
   />
 
  <!---
   Param the trim value flag. We are defaulting this
   to true. In that case, we will trim the value of
   the GENERATED CONTENT (not the Value attribute).
  --->
  <cfparam
   name="ATTRIBUTES.trimvalue"
   type="boolean"
   default="true"
   />
 
 </cfif>
 
 <!---
  Check to see if this tag as a closing tag. If it does,
  then we might be sending the value of the generated
  content instead of the value attribute.
 --->
 <cfif THISTAG.HasEndTag>
 
  <!---
   This tag might just be self closing (which would
   be considered a closing end tag. In that case, we
   won't have any length in our generated content
   (the content between the opening and closing tags.
   Check the length of the generated contet.
  --->
  <cfif Len( THISTAG.GeneratedContent )>
 
   <!---
    Since we have generated content, we are going
    to be using that as our list item value.
    Check to see if we need to trim this.
   --->
   <cfif ATTRIBUTES.trimvalue>
 
    <!---
     Trim value and save it into the attributes.
     We don't need to store into attributes, but
     we already have the value, so why not.
    --->
    <cfset ATTRIBUTES.value = THISTAG.GeneratedContent.Trim() />
 
    <!--- Erase the generated content. --->
    <cfset THISTAG.GeneratedContent = "" />
 
   </cfif>
 
  </cfif>
 
 </cfif>
 
</cfsilent>

 

 

 

 

 

< -------------------------------------------------------------------------------然后来看 list.cfm----------------->

 

 

 

 

 

 

 

 

<cfsilent>
 
 <!---
  Check to see if we are in the start mode of the tag. There
  is no need to param any attributes after the start mode.
 --->
 <cfif (THISTAG.ExecutionMode EQ "Start")>
 
  <!---
   Param the align attribute. This till determine if we
   show the list one after another in-line, or if the
   list should be displayed as block elements.
 
   Possible values:
   - horizontal (default)
   - vertical
  --->
  <cfparam
   name="ATTRIBUTES.align"
   type="string"
   default="horizontal"
   />
 
 </cfif>
 
</cfsilent>
 
<!---
 Since this is a parent tag that is designed to have child
 tags, we can't really do anything until the child tags have
 been defined. Therefore, we can only really work in the
 End mode of execution.
--->
<cfif (THISTAG.ExecutionMode EQ "End")>
 
 <!---
  ASSERT:
  At this point, we should have all the child tags
  associated with this parent tag. As per the child tags,
  all the attribute data should be in a structure:
  THISTAG.Items.
 --->
 
 <!---
  Now, we have to check to see how to display the items.
  Vertically or horizontally?
 --->
 <cfif (ATTRIBUTES.align EQ "vertical")>
 
  <!--- Display veritcally. --->
 
  <!---
   Loop over the Items array. Remember, this array
   contains the attributes of the child tags. Remember
   to use CFOutput tags as custom tags are NOT natural
   CFOutput blocks.
  --->
  <cfoutput>
 
   <cfloop
    index="intI"
    from="1"
    to="#ArrayLen( THISTAG.Items )#"
    step="1">
 
    <!--- Output value. --->
    <p>
     Item #intI#: #THISTAG.Items[ intI ].value#
    </p>
 
   </cfloop>
 
  </cfoutput>
 
 <cfelse>
 
  <!---
   We are going with the default, which is vertical.
   You might think the first CFIF clause should be the
   default statement since the default is probably the
   most often used. By making the default the ELSE
   clause, we don't really have to validate the types
   passed in. But that's not really here nor there.
  --->
 
  <!---
   Loop over the Items array. Remember, this array
   contains the attributes of the child tags. Remember
   to use CFOutput tags as custom tags are NOT natural
   CFOutput blocks.
  --->
  <cfoutput>
 
   <cfloop
    index="intI"
    from="1"
    to="#ArrayLen( THISTAG.Items )#"
    step="1">
 
    <!--- Output value. --->
    Item #intI#: #THISTAG.Items[ intI ].value#
 
   </cfloop>
 
  </cfoutput>
 
 </cfif>
 
</cfif>

 

 

 

<!----最后是 testList.cfm--------------------->

 

 

<!--- Our parent list tag. --->
<cf_list align="horizontal">
 
 <!--- A sub tag: item.cfm. --->
 <cf_item>
  Ashley Thomas
 </cf_item>
 
 <!--- A sub tag: item.cfm. --->
 <cf_item>
  Sarah Vivenzio
 </cf_item>
 
</cf_list>

 

 

运行结果:

Item 1: Ashley Thomas Item 2: Sarah Vivenzio

 

从这里我们就可以看出来nested custom tag, 它可以使得parent tag 调用到child tag 的属性。

还有其他的特性,但是在这个例子里还没完全展示,通过多的实践就会体会到的它的power

 

 

 

 

 

别再只盯着轨迹线了!FLUENT DPM后处理实战:从粒子采样到直方图报告的完整流程 本文详细介绍了FLUENT DPM后处理的完整流程,从粒子采样到直方图报告的实战技巧。通过设置采样面、分析.dpm文件数据以及创建加权直方图,帮助工程师获取粒子速度、粒径分布等定量信息,提升多相流模拟的深度分析能力。特别适合需要超越轨迹线分析的CFD工程师。 阅读详情

相关推荐

RPA 财务共享中心与RPA赋能

在和集团财务官交流的时候,客户经常会提到FSSC,其中有准备建立FSSC,正在建立FSSC,以及已建成FSSC正使用的,当中会有些对FSSC的疑虑和问题,所以花费些时间对FSSC进行了深入调研,从而也有幸拜读了王兴山、陈剑、梅震、钱自严等专业人士写的几本关于FSSC的书,对FSSC的前因后果有了更深入的认识,同时结合自己在FSSC的一些项目经验,故做了本次分享。 本文章主要分享财务共享中心以及R...

weixin_40244959的博客 2756

“Property or method “***“ is not defined on the instance but referenced during render.”报错的原因及解决方案

报错问题: 在使用vue-cli运行项目的过程中,在VScode中不报错,但在浏览器调试工具中发出 [Vue warn]: Property or method "pic" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by in.

酷爱前端的小陈博客 18万+

主流双目相机技术参数横向评测:从ZED到INDEMIND的深度解析

本文对主流双目相机进行了深度横向评测,涵盖ZED、Bumblebee、Leap Motion、DUO 3D及INDEMIND等国内外产品。文章详细解析了分辨率、帧率、视场角、基线等核心参数,并结合科研、机器人导航、无人机、工业检测等典型应用场景,提供了实战选型指南,帮助读者根据具体需求挑选最合适的双目视觉解决方案。

weixin_29212867的博客 640

Property or method "list" is not defined on the instance but referenced during render.解决

一、问题描述 在之前的项目开发中,也遇到了这样的一个问题, Property or method "list" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-b...

浮生离梦的博客 3万+

泛微ecology9二次开发-附件上传接口实战:从表单创建到数据库存储解析

本文详细解析了泛微ecology9二次开发中的附件上传接口实战,从测试环境搭建、数据库表结构解析到接口代码实现,提供了全面的开发指南。重点介绍了文件上传的核心逻辑、常见问题排查及高级应用场景,帮助开发者高效实现附件上传功能并优化系统性能。

weixin_30836759的博客 477

即插即用篇 | 手把手教你 YOLOv11 添加注意力机制 | 适用于【检测任务】【分类任务】【分割任务】【关键点任务】| 20+ 种全打通!

即插即用篇 | 手把手教你 YOLOv11 添加注意力机制 | 适用于【检测任务】【分类任务】【分割任务】【关键点任务】| 20+ 种全打通!

Coding... 2831

下载(导出)pdf模板文件(比如:审批单),报错:Invalid nested tag *** found, expected closing tag ***

html转xhtml格式化

qq_37967380的博客 1792

华为OD机试真题 新系统2026-04-01 Python&JS【计算数列位置N的值】

如果其前面的M个元素中,存在值相同的元素,则该位置上的数值等于前面M个数中最大的数值与最小的数值之如果其前面的M个元素中,不存在值相同的元素,则该位置上的数值等于前面M个数中最大的数值与最小的数值之差;1、输入M、N两个数,则按照以下规则形成一个数列;两个整数,用逗号分割,分别表示M和N。一个整数,表示数列第N个位置上的数值。2、数列的前M个元素的值为1到M;请计算该数列第N个位置上的数值。N取值范围:1<= N<=50。M取值范围:3<=M<=10。

MISAYAONE的博客 3217

Property or method “xxx“ is not defined on the instance but referenced during render. Make sure that

如果xxx 方法确实已经定义在 Vue 组件的方法选项中,那么这通常意味着该方法所在的组件实例没有正确地挂载或初始化。如果以上步骤都没有解决问题,建议检查整个组件的代码,特别是 methods 部分和模板部分,确保所有部分都正确无误。确保在模板中调用 xxx 方法的地方拼写正确,并且没有拼写错误。确保xxx 方法位于 Vue 组件的 methods 选项中。如果你在父组件中使用了这个子组件,确保子组件已正确注册并导入。报错信息意为:报错信息提示xxx 方法未定义,确认 xxx 方法没有被其他同名方法覆盖。

SSHLY3的博客 5327

【PX4学习笔记】3. PX4 固件烧写(1 探索过程)

飞控型号:cube orange【PX4官方用户指南中关于cube orange的描述】 飞控载板型号:Mini Carrier Board【迷你载板说明文档】 固件安装参考:The Cube User Manual V1.0

【人工智障 | 计算鸡视觉 | 机器孩】 7676

1分钟了解LangChain是什么?

是一个基于大型语言模型(LLM)开发应用程序的框架, 它旨在简化语言模型应用的开发流程,特别是在构建对话系统和其他基于语言的AI解决方案时.目标是将复杂的语言模型技术转化为可通过简单API调用实现的功能,从而使开发者能够更加专注于创造性的解决方案设计。高效地解决了开发大语言模型应用的痛点问题。Langchain 最主要的特色是可以将 LLM 应用研发过程中的交互 Prompt、LLM 模型调用、语言模型与环境互动的自适应等方式融为一体。

gorgor在码农 2630

Property or method “XXX“ is not defined on the instance but referenced during render. Make sure that

Property or method "xxxxx" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property. See:

SSHLY3的博客 1157

解锁PyCharm+Deepseek:本地部署AI编程超能力

在本次探索中,我们成功地在 PyCharm 中实现了 DeepSeek 的本地化部署,这一过程虽然涉及多个步骤,但每一步都为我们开启 AI 编程大门奠定了基础。从安装最新版 PyCharm,确保我们拥有一个功能强大且兼容性良好的开发环境,到注册 DeepSeek 账号并获取 API Key,这是连接我们与强大 AI 能力的关键纽带。接着,在 PyCharm 中安装 Continue 插件并进行精细配置,让 DeepSeek 能够深度融入我们的编程流程。

远程部署调试 运行安装 项目调试 二次开发 项目技术新 持续迭代 部分源码免费分享 5548

Vue2 错误排查|彻底解决[Vue warn]: Property or method ‘xxx‘ is not defined on instance问题

摘要 Vue2开发中常见的Property or method 'xxx' is not defined警告,通常是由于模板中引用的属性/方法未在data、methods、computed或props中定义,或存在语法错误。核心解决思路包括: 检查data语法:组件中data必须为函数返回对象,否则会导致解析失败。 名称一致性:确保模板中的拼写、大小写与定义完全一致。 配置项位置:属性/方法需定义在data或methods等配置项内部,而非外部。 this指向问题:异步回调中使用箭头函数避免this指向错误

那些看似不起波澜的日复一日,会在某天让你看到坚持的意义 755

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

html转pdf报错 Invalid nested tag head found, expected closing tag link.

主要是expected closing tag link.这句话的意思,意思没有闭合标签 原因是:itexthtml转pdf对html格式要求比较严格,比如link标签 必须是</link>这种结束标签,其他标签报错同理 我用的是这3个依赖 ...

程序员 5121

精雕软件(JDpaint) 5.5 绿色版

精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版

Invalid nested tag p found, expected closing tag br.

1.导出pdf的时候,html标签必须一一对应,如果有一个对应不上就会报错。 2.以上错误看下 代码中有没有<br>的标签,看看有没有<br/>结尾,如果只有<br>没有<br/>结尾,直接将<br>替换成<br/>. ...

u010125432的博客 3230

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

打印PDF文件 报错:Invalid nested tag br found, expected closing tag

在打印HTML、jsp等页面为PDF时,显示了Invalid nested tag br found, expected closing tag XX等信息的话,说明你的标签没有正确的闭合。比如:&lt;tr&gt;  &lt;/td&gt;,一定要仔细检查要打印的页面标签,这里有一个问题,那就是换行符号&lt;br&gt;怎么解决。如下: &lt;div&gt; &lt;p&gt; ...

明天的你会感谢今天的自己 1万+

django关于modles

1.ORM 对象-关系映射(OBJECT/RELATIONALMAPPING,简称ORM),是随着面向对象的软件开发方法发展而产生的。用来把对象模型表示的对象映射到基于S Q L 的关系模型数据库结构中去。这样,我们在具体的操作实体对象的时候,就不需要再去和复杂的 SQ L 语句打交道,只需简单的操作实体对象的属性和方法 。O R M 技术是在对象和关系之间提供了一条桥梁,前台的对象型数据和数据...

Mr_Slower的博客 1989

Invalid nested tag br found, expected closing tag li 错误解决

在用第三方模板itext来生成pdf的时候,报了以下的错误:com.itextpdf.tool.xml.exceptions.RuntimeWorkerException: Invalid nested tag br found, expected closing tag li. at com.itextpdf.tool.xml.XMLWorker.endElement(XMLWo

茕夜 1万+

【JAVA秒会技术之玩转PDF】IText转PDF秒会

IText转PDF秒会 最近在开发过程中,碰到了这样的需求:将图片及相关文字信息,按视觉标准,排版后直接转成PDF。因为之前没接触过,乍一听很懵,感觉会很难。但经过一番网上搜索学习后,发现其实很简单! (一)Maven引入依赖 注意:一定要按此版本号引入,不然会出现很多错误,包括“中文乱码、中文不输出或直接报错”等异常! ...

weixin_34256074的博客 316

Invalid nested tag br found, expected closing tag(...)

com.itextpdf.tool.xml.exceptions.RuntimeWorkerException: Invalid nested tag br found, expected closing tag td. 标签下br换行标签未关闭,此时去查看文件理的内容,看是否有br标签未关闭,发现br的标签是这样写的 然后并没有在前面加上 因为这个第三方模板生成的时候,要求一些网页的标签必须有开...

2斤理想 2196

list

的底层是双向链表结构,双向链表中每个元素存储在互不相关的独立节点中,在节点中通过指针指向其前一个元素和后一个元素。,因此反向迭代器的实现可以借助正向迭代器,即:反向迭代器内部可以包含一个正向迭代器,对正向迭代器的接口进行包装即可。是可以在常数范围内在任意位置进行插入和删除的序列式容器,并且该容器可以前后双向迭代。迭代到该位置,在这段位置上迭代需要线性的时间开销;最大的缺陷是不支持任意位置的随机访问,比如:要访问。还需要一些额外的空间,以保存每个节点的相关联信息。个元素,必须从已知的位置。

xie0510_的博客 268

Java 集合框架(List、Set、Map)与常用基础

本文整理Java集合框架核心知识,涵盖集合体系、Collection接口API、List(ArrayList、LinkedList、Vector)、Set(HashSet、TreeSet)、Map(HashMap、TreeMap、Hashtable)实现类原理、泛型、增强for循环、可变参数与工具类,并附核心易错点速查表。

既然你都点开这里了,那可以给我点个关注吗?可以吗?可以吗? 483

Bugku 326 Baby-heap1 题解:glibc 2.23 堆溢出到 FSOP 劫持 _IO_list_all(附完整 exp)

为什么 FSOP 在 2.23 这么好用?glibc 2.23 的_IO_FILE虚表调用没有 vtable 合法性检查是 2.24 才加入的),只要能把指向自己伪造的 FILE,就能让__overflow槽位指向任意函数。exit()一定会走因此把_mode置 0、置 1、置 0,就能进入;把fp首地址写成/bin/shsystem(fp)的参数就齐了。为什么用 fastbin attack 而不是?2.23 没有 tcache,fastbin 的fd。

kingx3的博客 183

[C++]:7.STL:list

好久不见,firdawn小课堂又和大家见面啦。今天我们要学习的内容是list容器,list也是一种常用的数据结构。下面是本章的思维导图,那么让我们开始学习吧!自定义的list,由三个结构构成。分别是链表的最小组成单位,也就是链表节点。以及迭代器类和list类其实要特别说明的是, List的迭代器,它不是单纯的指针,因为我们如果对指针直接进行解引用操作的话,我们得到的是这个节点,而不是节点里面存储的值并且我们对这个指针加加,得到的也不是下一个节点的地址,而是所在节点的下一个单位的地址。

2301_80817679的博客 176
上一篇: [coldfusion] custom tag paried 与empty的区别
下一篇: 关于RDS 项目中Eclipse中用到RDS configure 不了解,所以找了一些资料看看。
lovejavalovejava
博客等级 码龄19年 56粉丝 62原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值