【发布时间】:2014-02-06 15:10:15
【问题描述】:
我正在尝试根据为第一个值选择的内容来显示第二种选择方法。现在我需要为我正在制作的表格执行此操作超过 38 次,但我想看看我是否可以先解决一个问题。这是到目前为止我在 jsf 页面上剪切的代码。其他 38 个问题的值都相同。我刚刚重新创建了项目,到目前为止 bean 是空的,但我知道我应该能够首先看到表单,这是我现在希望在添加值和代码之前做的。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://java.sun.com/jsf/core" >
<h:head>
<title>QC-Form</title>
</h:head>
<h:body>
<h1 class="title">QC Form</h1>
<br/> <br/>
<font face="comic sans MS" size="2" color="#33CCFF">
<p><b>Enter the information below: </b> </p>
</font>
<h:form>
<font face="comic sans MS" size="2">
<b>Your initials: </b>
<h:inputText value="#{qcFormBean.techNameValue}"/><br/>
<br/>
<b>Model #: </b>
<h:selectOneMenu value="#{qcFormBean.modelValue}">
<f:selectItem itemValue="3600" itemLabel="3600" />
<f:selectItem itemValue="7200" itemLabel="7200" />
<f:selectItem itemValue="8300" itemLabel="8300" />
<f:selectItem itemValue="8400" itemLabel="8400" />
<f:selectItem itemValue="8500p" itemLabel="8500p" />
<f:selectItem itemValue="8800" itemLabel="8800" />
<f:selectItem itemValue="9000" itemLabel="9000" />
<f:selectItem itemValue="9008" itemLabel="9008" />
<f:selectItem itemValue="9200" itemLabel="9200" />
<f:selectItem itemValue="9300" itemLabel="9300" />
</h:selectOneMenu><br/>
<br/>
<b>Date : </b>
<h:outputText value="#{currentDate}"/>
<br/> <br/>
<b>Serial #: </b>
<h:inputText value="#{qcFormBean.serialValue}"/><br/>
<br/>
<b>Customer Name: </b>
<h:inputText value="#{qcFormBean.customerNameValue}"/><br/>
<br/>
<b>Special Instructions: </b>
<h:inputText value="#{qcFormBean.specialInstructionsValue}"/><br/>
</font>
<font face="comic sans MS" size="2" color="#33CCFF">
<p><b>QC Process</b> </p>
</font>
<font face="comic sans MS" size="2">
<b>1.Unit Serial number has been applied: </b>
<h:selectOneMenu value="#{qcFormBean.unitSerialValue}">
<f:selectItem itemValue="P" itemLabel="Pass or Not Applicable" />
<f:selectItem itemValue="A" itemLabel="FAIL-Nonfunctional" />
<f:selectItem itemValue="B" itemLabel="FAIL-Intermittent" />
<f:selectItem itemValue="C" itemLabel="FAIL-Incorrect" />
<f:selectItem itemValue="D" itemLabel="FAIL-DLI Standard" />
<f:selectItem itemValue="F" itemLabel="FAIL-Special Standard" />
<f:selectItem itemValue="G" itemLabel="FAIL-Physical" />
</h:selectOneMenu>
<br/>
<br/>
<b>2.Screen Protector has been applied: </b>
<h:panelGroup id="dliSticker">
<h:selectOneMenu value="#{qcFormBean.dlitcStickerValue}">
<f:selectItem itemValue="P" itemLabel="Pass or Not applicable" />
<f:selectItem itemValue="M" itemLabel="FAIL-Mechanical" />
<f:selectItem itemValue="E" itemLabel="FAIL-Electrical" />
<f:selectItem itemValue="C" itemLabel="FAIL-Cosmetic" />
<f:selectItem itemValue="S" itemLabel="FAIL-Software" />
<f:ajax event="change" execute="@this" render="perfbyDlitcSticker" />
</h:selectOneMenu>
</h:panelGroup>
<h:panelGroup id="perfbyDlitcSticker">
<h:selectOneMenu value="#{qcFormBean.stickerFreq}"
rendered="#{!qcFormBean.dliStickerValue eq 'P'}">
<f:selectItem itemValue="A" itemLabel="Always" />
<f:selectItem itemValue="O" itemLabel="Often" />
<f:selectItem itemValue="S" itemLabel="Seldom" />
</h:selectOneMenu>
</h:panelGroup>
<br/>
</font>
</h:form>
</h:body>
</html>
这是我使用此代码得到的错误代码:
/indexv2.xhtml 第 88 行第 76 列 Parent 不是复合组件或 ClientBehaviorHolder 类型,类型为:javax.faces.component.UIViewRoot@13fcf10
原因: javax.faces.view.facelets.TagException - /indexv2.xhtml 在第 88 行和第 76 列父级不是复合组件或 ClientBehaviorHolder 类型,类型为:javax.faces.component.UIViewRoot@13fcf10
【问题讨论】: