javax.faces.view.facelets.TagAttributeException [英] javax.faces.view.facelets.TagAttributeException

查看:81
本文介绍了javax.faces.view.facelets.TagAttributeException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用JSF创建一个小型应用程序,面对该异常,下面是表单的代码.

I'm creating a small application using JSF,facing the exception, below is the code for the form.

  <h:form>

 <h:selectManyCheckbox value="#{transferMB.selectedItems}">
    <f:selectItem itemValue="1" itemLabel="Transfer Status" />
      <p:ajax update=":transForm" />
 </h:selectManyCheckbox>

</h:form>

异常"javax.faces.view.facelets.TagAttributeException:"

exception " javax.faces.view.facelets.TagAttributeException:"

推荐答案

这是如此处所述,您需要使用EL 2.2在EL-Expressions内部传递参数.似乎您不使用它.

As mentioned there, you need to use EL 2.2 for passing parameter inside EL-Expressions. Seems you don't use that.

所以我们需要另一种解决方法:

So we need another way to get this solved:

<h:form id="transForm">
    <p:panelGrid columns="1" rendered="#{transferMB.transFormEnabled}">
        <h:outputText value="transForm"/>
    </p:panelGrid>
</h:form>
<h:form id="spreadForm">
    <p:panelGrid columns="1" rendered="#{transferMB.spreadFormEnabled}">
        <h:outputText value="spreadForm"/>
    </p:panelGrid>
</h:form>

并在相应的bean中:

and in your corresponding bean:

public boolean isTransFormEnabled() {
    if (selectedItems.contains("1")) {
        return true;
    } else {
        return false;
    }
}
public boolean isSpreadFormEnabled() {
    if (selectedItems.contains("2")) {
        return true;
    } else {
        return false;
    }
}

这篇关于javax.faces.view.facelets.TagAttributeException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆