我正在尝试使用 icefaces 1.8 在 UI 片段中添加 JSF selectOneMenu,并且无论我做什么都无法渲染它。我可以让它在普通的 jspx 页面中呈现,但不能在 ui 片段中呈现。
<ui:fragment xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ice="http://www.icesoft.com/icefaces/component">
<ice:selectOneMenu id="myselect"
style="width:100px"
value="#{someField}"
rendered="true">
<f:selectItem itemValue="1" itemLabel="1"/>
<f:selectItem itemValue="2" itemLabel="2"/>
<f:selectItem itemValue="3" itemLabel="3"/>
</ice:selectOneMenu>
</ui:fragment>
我错过了一些基本的东西吗?我是 JSF 的新手。如果我将完全相同的 selectOneMenu 拉出到 jspx 中,它应该可以正常工作,但是当我包含一个 ui 片段时它不会。
编辑 BalusC:
该片段稍后在一个 jspx 文件中使用,该文件与
<ui:include src="myfile.jspx">
<ui:param name="someField" value="#{beanName.someField}"
</ui:include>
我要离开现有的 . 包含中还有更多内容可以按预期工作,我可以将 outputText 等其他组件添加到 ui:fragment 中,但这没有任何区别。完整片段如下。我也可以从 jspx 发布完整的包含。
<ui:fragment xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ice="http://www.icesoft.com/icefaces/component">
<ice:panelGrid cellspacing="0" cellpadding="0" columns="3">
<!-- This component is displayed when the form is opened for editing or display mode-->
<ice:panelGroup rendered="#{not beanName.outputOnlyView }">
<!-- This component is displayed when the form is opened for display mode in EDM stage-->
<ice:panelGroup rendered="#{beanName.displayMode}">
<ice:outputText
id="#{fieldId }"
style="#{inlineStyleField}"
value="#{fieldValue}" >
</ice:outputText>
</ice:panelGroup>
<ice:selectOneMenu id="myselect"
style="width:100px"
value="#{someField}"
rendered="#{not beanName.outputOnlyView}">
<f:selectItem itemValue="IntranetID" itemLabel="Intranet ID"/>
<f:selectItem itemValue="Name" itemLabel="Last Name, First Name"/>
<f:selectItem itemValue="KnownAs" itemLabel="Known As"/>
</ice:selectOneMenu>
<!-- This component is displayed when the form is opened for editing mode in Submitter stage-->
<ice:panelGroup rendered="#{!beanName.displayMode}" panelTooltip="#{fieldId}Help">
<ice:panelGrid style="#{inlineStyle}" cellspacing="0" cellpadding="0" columns="3">
<!-- Column 1 the component -->
<ice:selectInputText id="#{fieldId }"
binding="#{feildBinding}"
options="{frequency:0.4}"
rows="20"
width="100"
partialSubmit="true"
immediate="true"
autocomplete="true"
value="#{fieldValue}"
rendered="#{not beanName.outputOnlyView}"
readonly="#{beanName.globalReadOnly }"
listVar="employee"
listValue="#{beanName[employeeSelect].employeeNamePossibilities}"
valueChangeListener="#{beanName[valueChangeListener] }"
textChangeListener="#{beanName[textChangeListener]}">
<f:facet name="selectInputText">
<ice:panelGrid columns="1">
<ice:panelGrid columns="2" columnClasses="searchCol1,searchCol2">
<ice:outputText id="name" value="#{employee.name}"/>
<ice:outputText id="email" value="#{employee.email}"/>
</ice:panelGrid>
<ice:panelGrid columns="3" columnClasses="searchCol4,searchCol3,searchCol5">
<ice:outputText id="function" value="#{employee.function}"/>
<ice:outputText id="subfunction" value="#{employee.subfunction}"/>
<ice:outputText id="stat1" value="#{employee.stat1}"/>
</ice:panelGrid>
</ice:panelGrid>
</f:facet>
</ice:selectInputText>
<!-- Column 2: Error Messages for this component -->
<ice:message style="color:red;" id="#{fieldId}Error" for="#{fieldId}" showDetail="true"/>
<!-- Column 3: HoverHelp if required -->
<ui:include src="../inc-components-pcr/sub-components-pcr/hoverHelpColumnAndTooltip.jspx"/>
</ice:panelGrid>
</ice:panelGroup>
</ice:panelGroup>
</ice:panelGrid>
</ui:fragment>