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 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
|
<h:form id="create" class="clearfix" enctype="multipart/form-data" prependId="false">
<h:panelGroup rendered="#{not annonceBean.ajouterAnnonceNoError}">
<h2 class="s_title_1"><span class="s_secondary_color">Ajoutée une </span>annonce</h2>
<div class="clear"></div>
<h:messages style="color:red;margin:8px;"/>
<div class="s_row_2 clearfix">
<label class="required"><strong>Titre</strong></label>
<h:inputText id="nom" size="90" value="#{annonceBean.titre}"/>
</div>
<div class="s_row_2 clearfix">
<span class="info">Le titre doit contenir que les lettres majuscule ou miniscule et des espaces</span>
</div>
<div class="s_row_2 clearfix">
<label><strong>Catégorie</strong></label>
<h:selectOneMenu id="categorie" style="width: 200px;" value="#{annonceBean.idCategorie}" required="true">
<f:selectItem itemValue="#{null}" noSelectionOption="true" itemLabel="*******"></f:selectItem>
<f:selectItems value="#{annonceBean.categorieItems}"></f:selectItems>
</h:selectOneMenu>
</div>
<div class="s_row_2 clearfix">
<label><strong>Type</strong></label>
<div class="s_full">
<h:selectOneRadio id="type" value="#{annonceBean.idType}">
<f:selectItem itemValue="1" itemLabel="Offre" />
<f:selectItem itemValue="2" itemLabel="Demande" />
</h:selectOneRadio>
</div>
</div>
<div class="s_row_2 clearfix">
<label class="required"><strong>Description</strong></label>
<h:inputTextarea cols="90" rows="7" value="#{annonceBean.description}"/>
</div>
<div class="s_row_2 clearfix">
<span class="info">Il est recommandé d'utiliser des mots clé dans la description <a href="#" onclick="PF('dlg').show();">(comme cette liste)</a> pour que votre annonce soit bien défini</span>
</div>
<p:dialog id="tagsDialog" header="Liste des mots clés recommandées" widgetVar="dlg" height="300">
<ui:include src="../commun/tableau-tags.xhtml" />
</p:dialog>
<div class="s_row_2 clearfix offre">
<label class="required"><strong>Prix</strong></label>
<h:inputText value="#{annonceBean.prix}" size="30"/>
</div>
<div class="s_row_2 clearfix offre">
<h:panelGrid columns="3">
<label><strong>Tags</strong></label>
<p:autoComplete multiple="true" id="tagMultiple"
value="#{annonceBean.selectedTags}"
completeMethod="#{annonceBean.completeItem}" var="it"
itemLabel="#{it}" itemValue="#{it}" forceSelection="true">
<p:ajax event="itemSelect" />
<p:ajax event="itemUnselect" />
<p:column>
<h:outputText value="#{it}" />
</p:column>
</p:autoComplete>
<label>Choisir au moin un tag (exemple : Gateau, salé, ...)</label>
</h:panelGrid>
</div>
<div class="s_row_2 clearfix offre">
<label class="required"><strong>Photo</strong></label>
<label style="width:220px">sa taille ne doit pas dépasser 2 Mo</label>
</div>
<div class="s_row_2 clearfix offre">
<label class="required"></label>
<p:fileUpload mode="simple" allowTypes="/(\.|\/)(gif|jpe?g|png)$/" value="#{annonceBean.photo}" id="photo"/><br/>
</div>
<div class="s_row_2 clearfix offre">
<label class="required"></label>
<p:graphicImage value="#" height="150" binding="#{image}" id="photo2"/>
</div>
<h:commandLink styleClass="s_button_1 s_main_color_bgr left" action="#{annonceBean.addAnnonce}">
<span class="s_text offreBtn">Ajouter l'annonce</span>
<f:ajax execute="@form" render="@form" />
</h:commandLink>
<a class="s_button_1 s_ddd_bgr left" onclick="$('#create').reset();"><span class="s_text">Reinitialiser</span></a>
</h:panelGroup>
<h:panelGroup rendered="#{annonceBean.ajouterAnnonceNoError}">
<span class="info">Votre annonce a bien etait ajoutée et elle est en attente de validation</span><br/><br/>
<p>Voudriez-vous ajoutée d'autres annonces ?</p><br/><br/>
<h:commandLink styleClass="s_button_1 s_main_color_bgr left" action="#{annonceBean.addNewAnnonce}">
<span class="s_text">Oui</span>
</h:commandLink>
</h:panelGroup>
</h:form> |
Partager