这是代码:
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:b="http://bootsfaces.net/ui"
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core">
<f:metadata>
<f:event type="preRenderView" listener="#{recBean.permission()}"/>
</f:metadata>
<h:head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.css"></link>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.js"></script>
<title>Reclamation</title>
</h:head>
<h:body>
<b:navBar brand="Reclamations" brandHref="ReclamationAll.xhtml" >
<b:navbarLinks>
<b:navLink value="Etats des Reclamation" href="InterventionAll.xhtml"></b:navLink>
<b:navLink value="Contrat" href="ContratAll.xhtml"></b:navLink>
<b:navLink value="La liste de nos produit" href="produitAll.xhtml"></b:navLink>
</b:navbarLinks>
</b:navBar>
<f:view>
<script type="text/javascript">
function success() {
toastr.success("Réclamation ajouté avec success !");
}
</script>
<h:form>
<h1><h:outputText value="Reclamation"/></h1>
<h:panelGroup id="result">
<h:panelGrid columns="2" cellpadding="2" >
<h:outputLabel value="Client:" for="client" />
<b:selectOneMenu id="client" value="#{sessionScope.idcli}" disabled="#{sessionScope.idcli==null ? false : true }" >
<!-- fixed -->
<f:selectItems value="#{recBean.clientSelect}" />
</b:selectOneMenu>
<h:outputLabel value="Produit:" for="produit" />
<b:selectOneMenu id="produit" value="#{recBean.idproduit}" >
<!-- fixed -->
<f:selectItems value="#{recBean.produitSelect}" />
</b:selectOneMenu>
<h:outputLabel value="Nom De Reclamation" for="descCli" />
<b:inputText id="nomRec" value="#{recBean.rec.nomRec}" title="Nom De Reclamation" required="true" requiredMessage="The DescCli field is required."/>
<h:outputLabel value="DateCreRec:" for="dateCreRec" />
<b:dateTimePicker id="dateCreRec" show-date="true" mode="toggle-icon" required="true" use-current="true" value="#{recBean.rec.dateCreRec}"/>
<h:outputLabel value="TypeRec:" for="type"/>
<h:selectOneRadio id ="type" value="#{recBean.type}">
<f:selectItem itemValue="réclamation logiciel" itemLabel="Reclamation Logiciel"></f:selectItem>
<f:selectItem itemValue="réclamation technique" itemLabel="Reclamation technique"></f:selectItem>
</h:selectOneRadio>
<h:outputLabel value="DescCli:" for="descCli" />
<b:inputTextarea id="descCli" value="#{recBean.rec.descCli}" title="DescCli" required="true" requiredMessage="The DescCli field is required."/>
<h:outputLabel value="DegUrgence:" for="degUrgence" />
<b:selectOneMenu id="degUrgence" value="#{recBean.degreurgence}" >
<f:selectItem itemValue="" itemLabel=""></f:selectItem>
<f:selectItem itemValue="1" itemLabel="urgente"></f:selectItem>
<f:selectItem itemValue="2" itemLabel="très urgente"></f:selectItem>
<f:selectItem itemValue="3" itemLabel="pas urgente"></f:selectItem>
</b:selectOneMenu>
</h:panelGrid>
</h:panelGroup>
<b:form horizontal="true">
<b:commandButton value="Ajouter" action="#{recBean.ajouter()}" onclick="success();" >
<f:ajax execute="@form" render="result" />
</b:commandButton>
<b:commandButton value="retourner a la liste " action="ReclamationAll.xhtml"/>
</b:form>
</h:form>
</f:view>
</h:body>
</html>
我将panelGrid插入panelGroup,希望使用ajax渲染使用commandButton渲染面板组ID 当我打开页面时出现此错误:
message无效的搜索表达式:result子表达式结果 不存在,或者无法解决。 net.bootsfaces.component.commandButton.CommandButton j_idt11:j_idt33:j_idt34附加信息:找不到ID:结果 搜索表达式:结果
我在这里做错了吗?先谢谢你。