【问题标题】:targetAttributeName attribute not defined未定义 targetAttributeName 属性
【发布时间】:2012-07-07 04:14:15
【问题描述】:

为什么我的复合组件中无法识别 targetAttributeName

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui"
      xmlns:cc="http://java.sun.com/jsf/composite">

    <!-- INTERFACE -->
    <cc:interface componentType="myComponentExample">
      <cc:targetAttributeName..../>
    </cc:interface>
..

我看到这个:“组件库Composite Components没有 包含组件 targetAttributeName"

我可以看到我没有 targetAttributeName 和 clientBehaviour 属性,为什么?

我正在使用 Netbeans 7.1、MyFaces 2.1.8 和 TomEE 1.0(主干更新)

这个属性是从 JSF 2.1 开始的,但我不能使用它

pom.xml:

<dependency>
            <groupId>org.apache.myfaces.core</groupId>
            <artifactId>myfaces-api</artifactId>
            <version>2.1.8</version>
            <scope>provided</scope>
        </dependency>

         <!--Apache MyFaces-->
        <dependency>
            <groupId>org.apache.myfaces.core</groupId>
            <artifactId>myfaces-impl</artifactId>
            <version>2.1.8</version>
            <scope>provided</scope>
        </dependency>

我只能看到这个属性:

  • 姓名
  • 默认
  • 显示名称
  • 专家
  • 身份证
  • 方法签名
  • 父母
  • 首选
  • 渲染
  • renderType
  • 需要
  • 简短说明
  • 目标
  • 瞬态
  • 类型

【问题讨论】:

    标签: jsf jsf-2 composite-component


    【解决方案1】:

    这个标签根本不存在。您很可能会混淆 &lt;cc:attribute&gt; 的属性是一个单独的标签。

    <cc:attribute targetAttributeName="..." />
    

    要了解 JSF 2.1 中可用的所有标签(和属性!),请访问VDL documentation

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-10-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多