`
wangzl2222
  • 浏览: 151976 次
  • 性别: Icon_minigender_1
  • 来自: 苏州
社区版块
存档分类
最新评论

警告: 'for' attribute cannot be null

阅读更多
在用seam+jsf组合开发时,有时遇到警告: 'for' attribute cannot be null 错误,结果研究终于解决了,原因是我们经常用模板开发,例如:
<s:decorate id="nameField" template="/layout/edit.xhtml" >
    <ui:define name="label">标题</ui:define>
    <s:label id="imageCaption" value="#{systemImageHome.instance.caption}" />
</s:decorate>
layout/edit.xhtml这个里面是这样的(大多数)
<s:label styleClass="name #{invalid?'errors':''}">
            <ui:insert name="label"/>
            <s:span styleClass="required" rendered="#{required}">*</s:span>
        </s:label>

        <span class="value #{invalid?'errors':''}">
            <s:validateAll>
                <ui:insert/>
            </s:validateAll>
        </span>

        <span class="error">
            <h:graphicImage value="/img/error.gif" rendered="#{invalid}" styleClass="errors"/>
            <s:message styleClass="errors"/>
        </span>
不知道大家看到没有这个 <s:message>组件,他会寻找父容器中第一个可编辑的组件,但是在<s:decorate>这个里面,现在没有一个可编辑的组件,所以 <s:message>得for就为null,所以如果没有可编辑的组件时应把edit.xhtml改为display.xhtml,这样就没错误了。如果还不懂可以留言,谢谢!
1
0
分享到:
评论
1 楼 yinlongfei 2010-04-29  
正好碰到这个问题,谢谢楼主的详细解答。

相关推荐

    求解报错:AttributeError:module ‘os’ has no attribute ‘exit’

    python3 server.py 127.0.0.1 8888 ...AttributeError: module ‘os’ has no attribute ‘exit’ 部分代码入下: from socket import * import sys,os #实现登录 def do_login(s,user,name,addr): for i in user: i

    Tomcat ssl报错Connector attribute SSLCertificateFile must be defined when using SSL with APR解决方法

    主要介绍了Tomcat ssl报错Connector attribute SSLCertificateFile must be defined when using SSL with APR解决方法,需要的朋友可以参考下

    Android Studio报:“Attribute application@theme or @ icon ”问题的解决

    前言 Android Studio是Google开发的一款面向Android开发者的IDE,支持Windows、Mac、Linux等操作系统...&gt; Manifest merger failed : Attribute application@theme value=(@style/AppTheme.NoActionBar) from AndroidMan

    ASP.NET MVC5 新特性:Attribute路由使用详解

    ### ASP.NET MVC5 新特性:Attribute路由使用详解 #### 一、Attribute路由简介与启用 在探讨Attribute路由之前,我们先来明确一下它的定义。**Attribute路由**是一种新的路由机制,它允许开发者直接在控制器的方法...

    问题解决:AttributeError: module ‘paddle.fluid’ has no attribute ‘EndStepEvent’

    在使用PaddlePaddle进行深度学习开发时,可能会遇到一个常见的错误:`AttributeError: module 'paddle.fluid' has no attribute 'EndStepEvent'`。这个问题通常发生在尝试使用PaddlePaddle的旧版本API或者在不正确的...

    FileAttribute

    FileAttribute::FileAttribute(const std::string& filePath) { // 初始化文件属性 } std::uint32_t FileAttribute::getAttributes() const { // 使用库获取文件属性 return fs::status(filePath).permissions()...

    Android代码-MultipleTheme

    MultipleTheme 真正的支持无缝换肤/夜间模式的Android框架,配合theme和换肤控件框架可以做到无缝切换换肤(无需重启应用和当前页面)。 该应用框架可以实现无缝换肤/切换夜间模式的...Setup 3:use attribute in l

    AttributeError: module 'tensorflow.compat.v1' has no attribute '

    AttributeError: module 'tensorflow.compat.v1' has no attribute 'contrib'的问题您具体怎么解决问题具体解决的seq_loss.py文件

    Attribute在.net编程中的应用(全).doc

    ### Attribute在.NET编程中的应用详解 #### 一、Attribute概述 在.NET编程中,Attribute是一个极为重要的特性,它类似于Java中的注解。Attribute主要用于为.NET框架中的类型、字段、方法和属性等添加元数据信息。...

    Submodular Attribute Selection for Visual recognition

    Submodular Attribute Selection for Visual Recognition Jingjing Zheng, Student Member, IEEE, Zhuolin Jiang, IEEE Member, Rama Chellappa, IEEE Fellow, and P. Jonathon Phillips, IEEE Member

    递归神经网络报错has no attribute 'core_rnn_cell'解决方案

    调试递归神经网络(RNN)的时候出现如下错误: AttributeError: module 'tensorflow.contrib.rnn' has no attribute 'core_rnn_cell' 顺便问一句,资源分怎么设置免费啊

    Attribute Aware Pooling for Pedestrian Attribute Recognition.pdf

    这篇文档的核心内容是关于一种新型的属性感知池化(Attribute Aware Pooling,简称AAP)算法,该算法被用来强化深度卷积神经网络(CNNs)在行人属性识别问题上的能力。行人属性识别问题在智能视频监控领域有着广泛的...

    Corsolas: AOP Attributed Framework-开源

    Corsolas AOP Attributed Framework for .NET 2.0 是一种处理面向切面编程的创新方式,基于属性,无需外部语言,以简单而强大的方式做到最好...... by maxtuno。

    pki-pkcs9规范

    可选属性类型。PKCS#9定义了PKCS#6扩展证书、PKCS#7数字签名消息、PKCS#8私钥信息和PKCS#10证书签名请求中要用到的可选属性类型。已定义的证书属性包括E-mail地址、无格式姓名、内容类型、消息摘要、签名时间、签名...

    .net中attribute实现方法调用拦截(就是aop)

    在.NET框架中,Attribute是一种元数据,用于向编译器、IDE、运行时环境等提供额外的信息。这些信息可以用来修饰类、接口、方法、属性等各种编程元素,从而实现特定的功能或扩展。AOP(面向切面编程)是一种编程范式...

    Recurrent attention model for pedestrian attribute recognition.pdf

    行人属性识别是一个旨在预测监控图像中行人的属性标签的计算机视觉任务,这项任务由于成像质量不佳和训练数据集小而极具挑战性。行人属性,例如年龄、发型和鞋子,是人类可搜索的语义描述,并且可以用作视觉监控应用...

    c#的attribute实例源码

    然后,在类上使用这个Attribute: ```csharp [Author("John Doe")] public class MyProgram { /* ... */ } ``` 2. **使用反射获取Attribute信息**:在运行时,我们可以通过反射来访问和处理Attribute。例如,获取`...

    Attribute在.net编程中的应用

    Attribute在.NET编程中的应用是一个关键的概念,它允许程序员在代码中添加元数据,这些元数据可以为运行时环境提供额外的信息,或者影响程序的行为。在.NET框架中,Attribute不仅仅是一个关键字,而是一个类,它是...

Global site tag (gtag.js) - Google Analytics