1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
|
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
<%@ taglib prefix="t" uri="http://myfaces.apache.org/tomahawk" %>
<%@ taglib prefix="a4j" uri="http://richfaces.org/a4j" %>
<%@ taglib prefix="rich" uri="http://richfaces.org/rich" %>
<f:subview id="addOuvrage">
<rich:panel>
<f:facet name="header">
<h:outputText value="Formulaire d'ajout d'un ouvrage"/>
</f:facet>
<h:form id="formAddOuvrage" enctype="multipart/form-data">
<h:outputText value="#{ouvrageBean.errorMsg}" style="color: red;"/>
<h:panelGrid columns="2" id="panelFormId">
<h:outputLabel value="Titre" for="titreInputText"/>
<h:inputText value="#{ouvrageBean.titre}" id="titreInputText"/>
<h:outputLabel value="Auteur" for="auteurInputText"/>
<h:inputText value="#{ouvrageBean.auteur}" id="auteurInputText"/>
<h:outputLabel value="Année de publication" for="anneeInputText"/>
<h:inputText value="#{ouvrageBean.annee}" id="anneeInputText"/>
<h:outputLabel value="Langue" for="langueSelect"/>
<h:selectOneMenu value="#{ouvrageBean.langue}" id="langueSelect">
<f:selectItems value="#{ouvrageBean.listeLangues}"/>
</h:selectOneMenu>
<h:outputLabel value="Type d'ouvrage" for="typeOuvrageSelect"/>
<h:selectOneMenu value="#{ouvrageBean.typeOuvrage}" id="typeOuvrageSelect">
<f:selectItems value="#{ouvrageBean.listeTypeOuvrage}"/>
</h:selectOneMenu>
<h:outputLabel value="Ouvrage sous forme de fichier" for="fileupload"/>
<t:inputFileUpload id="fileupload"
accept="image/*"
value="#{ouvrageBean.fichier}"
storage="file"
styleClass="fileUploadInput"
required="true"
maxlength="400000"/>
</h:panelGrid>
<rich:suggestionbox id="suggestionBoxId" for="auteurInputText" height="150" width="180"
status="auteurInputText"
fetchValue="#{result.nom}, #{result.prenom}" cellspacing="0" cellpadding="0"
suggestionAction="#{ouvrageBean.autocomplete}" var="result" nothingLabel="Aucun auteur">
<h:column>
<h:outputText value="#{result.nom}" style="font-style:italic"/>
</h:column>
<h:column>
<h:outputText value="#{result.prenom}" style="font-style:italic"/>
</h:column>
</rich:suggestionbox>
<h:commandButton type="submit" action="#{ouvrageBean.uploadOuvrage}"/>
</h:form>
</rich:panel>
</f:subview> |
Partager