How to make elements in one line JSF - jsf

How to make elements to render in one line like it is showed on image below:
Here is the code:
<h:outputLabel
value=" #{cdocmsgs['promo.action.name']} "
id="promo_action_name_id"/>
<h:selectOneMenu id="promotion" widgetVar="sub" tabindex="206"
styleClass="select-fix-average"
value="#{cdocBean.entity.promoActionName}" effect="fade"
required="#{cdocBean.entity.promotion}" requiredMessage="#{cdocmsgs['enter.promo']}">
<f:selectItem itemLabel="#{cdocmsgs['promoSelect']}"
itemValue="" />
<f:selectItems value="#{promoActionBean.DAO.resultList}"
var="item" itemLabel="#{item.name}" itemValue="#{item.name}" />
</h:selectOneMenu>
<h:outputText value="" />
<h:outputText value="" />
<h:outputLabel value=" #{cdocmsgs['source.of.info']} "
id="whenId"/>
<h:selectOneMenu id="source" widgetVar="sub"
styleClass="select-fix-average"
value="#{cdocBean.entity.source}" effect="fade" tabindex="206"
required="#{cdocBean.entity.promotion}" requiredMessage="#{cdocmsgs['enter.source']}">
<f:selectItem itemLabel="#{cdocmsgs['sourceSelect']}"
itemValue="" />
<f:selectItems value="#{adSourceBean.DAO.resultList}" var="item"
itemLabel="#{item.name}" itemValue="#{item.name}" />
</h:selectOneMenu>
I have placed h:panelGroup but it did not help.

You can use h:panelGrid like this:
<h:panelGrid columns="3" columnStyles="style1, style2, style3">
<jsfelement 1 />
<jsfelement 2 />
<jsfelement 3 />
<jsfelement 4 />
<jsfelement 5 />
<jsfelement 6 />
</h:panelGrid>
It will look like this:
element1 element2 element3
element4 element5 element6
And be rendered as a html table. You can of course style it as you like.

use a simple html would be one option.
or there are panelGrid and panelGroup in facelets to do that. usually the panlGroup is used inside the panelGrid to group multiple components into one cell.
an example: http://www.jsftoolbox.com/documentation/help/12-TagReference/html/h_panelGrid.html

You can achieve this by using a html table
<table width="100%" border="0" cellspacing="2" cellpadding="2">
<tr>
<td><h:outputLabel value=" #{cdocmsgs['promo.action.name']} "
id="promo_action_name_id"/></td>
<td><h:selectOneMenu id="promotion" widgetVar="sub" tabindex="206"
styleClass="select-fix-average"
value="#{cdocBean.entity.promoActionName}" effect="fade"
required="#{cdocBean.entity.promotion}" requiredMessage="#{cdocmsgs['enter.promo']}">
<f:selectItem itemLabel="#{cdocmsgs['promoSelect']}"
itemValue="" />
<f:selectItems value="#{promoActionBean.DAO.resultList}"
var="item" itemLabel="#{item.name}" itemValue="#{item.name}" />
</h:selectOneMenu></td>
<td><h:outputText value="" /></td>
<td><h:outputText value="" /></td>
</tr>
</table>

Related

blank space JSF not rendered components

I have the following code:
<h:form id="mainForm">
<p:panelGrid columns="2" layout="grid">
<h:panelGroup styleClass="containers" layout="block">
<p:outputLabel for="document" value="Document" />
<p:inputText id="document"
value="#{dIGRCController.digrc.documento}" readonly="true" />
<h:link styleClass="searchLink" value="Search Documents"
outcome="searchDigrc.xhtml"></h:link>
<!-- #{dIGRCController.digrc.impresn == 'S'} -->
<p:outputLabel for="concept" value="Concept" />
<p:selectOneMenu id="concept"
value="#{dIGRCController.digrc.qconce}"
requiredMessage="You must select a Concept" required="true">
<f:selectItem itemLabel="Select" itemValue="" />
<f:selectItems
value="#{cCRX1Controller.ccrx1.concepts.entrySet()}"
var="concept" itemValue="#{concept.key}"
itemLabel="#{concept.value.tbdesc}" />
<p:ajax listener="#{dIGRCController.setDropDownSelectedCcrx1}"
update="hiddenSections, searchAgentsLink, agenteName, documentValue, containerDocQty, containerMethodPayment" />
</p:selectOneMenu>
<p:outputLabel for="todaysDate" value="Date" />
<p:inputText id="todaysDate" readonly="true"
value="#{dIGRCController.digrc.fecha}" />
</h:panelGroup>
<h:panelGroup styleClass="containers" layout="block">
<h:panelGroup>
<p:outputLabel for="agenteName" value="Agent Name" />
<p:inputText id="agenteName"
readonly="#{dIGRCController.digrc.selectedDropDownCcrx1.tbqcon == 'D'}"
value="#{dIGRCController.digrc.nombre}" required="true"
requiredMessage="You must enter an Agent Name" />
<h:panelGroup id="searchAgentsLink">
<h:link styleClass="searchLink" value="Search Agents"
rendered="#{dIGRCController.digrc.selectedDropDownCcrx1.tbqcon == 'D'}"
outcome="searchAgex1">
<f:param name="concept" value="#{dIGRCController.digrc.qconce}" />
<c:if test="#{not empty dIGRCController.digrc.documento}">
<f:param name="documento"
value="#{dIGRCController.digrc.documento}" />
</c:if>
</h:link>
</h:panelGroup>
</h:panelGroup>
<p:outputLabel for="documentValue" value="Document Value" />
<p:inputText id="documentValue"
value="#{dIGRCController.digrc.documVal}" required="true"
requiredMessage="You must enter a Document Value"
validatorMessage="The Document Value must be greater than 0"
readonly="#{dIGRCController.digrc.selectedDropDownCcrx1.tbqcon == 9 or
dIGRCController.digrc.selectedDropDownCcrx1.tbqcon == 1 or
dIGRCController.digrc.selectedDropDownCcrx1.tbqcon == 'F'}">
<f:validateDoubleRange minimum="0.01" />
<p:ajax event="change" update="containerIdTwo"></p:ajax>
</p:inputText>
<h:panelGroup styleClass="containers" layout="block"
id="containerDocQty">
<h:panelGroup
rendered="#{dIGRCController.digrc.selectedDropDownCcrx1.pideqtysn == 'S'}">
<p:outputLabel for="documentQuantity" value="Document Quantity" />
<p:inputText id="documentQuantity"
value="#{dIGRCController.digrc.qtyDoc}" required="true"
requiredMessage="You must enter a Document Quantity" />
</h:panelGroup>
</h:panelGroup>
</h:panelGroup>
</p:panelGrid>
<p:panelGrid columns="1" layout="grid" id="hiddenSections">
<h:panelGroup styleClass="containers" layout="grid" id="moneyOrder"
rendered="#{dIGRCController.digrc.selectedDropDownCcrx1.tbqcon == 1}">
<h2>Money Orders</h2>
<p:outputLabel for="moneyOrdersQty" value="Quantity" />
<p:inputText id="moneyOrdersQty"
value="#{dIGRCController.digrc.moqty}" />
<p:outputLabel for="moneyOrdersVal" value="Value" />
<p:inputText id="moneyOrdersVal"
value="#{dIGRCController.digrc.moval}">
<p:ajax update="documentValue" event="change"
listener="#{dIGRCController.setDocValueToMoneyOrderValue()}" />
</p:inputText>
</h:panelGroup>
<h:panelGroup styleClass="containers" layout="block"
rendered="#{dIGRCController.digrc.selectedDropDownCcrx1.tbqcon == 8}">
<h2>Transfer Documents</h2>
<p:outputLabel for="numeroConduce" value="Transfer Number" />
<p:inputText id="numeroConduce"
value="#{dIGRCController.digrc.notransf}" required="true"
requiredMessage="You must enter a Number." />
<p:outputLabel for="suplidor" value="Supplier" />
<p:inputText id="suplidor" value="#{dIGRCController.digrc.c8supli}"
required="true" requiredMessage="You must enter a Supplier" />
<p:outputLabel for="tipoEnvio" value="Type of Transfer" />
<p:selectOneMenu id="tipoEnvio"
value="#{dIGRCController.digrc.c8tpenvio}"
requiredMessage="You must select a Type of Transfer"
required="true">
<f:selectItem itemLabel="Select" itemValue="" />
<f:selectItem itemLabel="Regular" itemValue="R" />
<f:selectItem itemLabel="Official" itemValue="O" />
<f:selectItem itemLabel="Express Regular" itemValue="E" />
<f:selectItem itemLabel="Express Official" itemValue="F" />
<p:ajax event="change" update="containerExtraEnvio"></p:ajax>
</p:selectOneMenu>
<p:outputLabel for="envioDestino" value="Destination" />
<p:selectOneMenu id="envioDestino"
value="#{dIGRCController.digrc.c8destino}"
requiredMessage="You must select a Destination" required="true">
<f:selectItem itemLabel="Select" itemValue="" />
<f:selectItem itemLabel="Capital" itemValue="C" />
<f:selectItem itemLabel="Interior" itemValue="I" />
</p:selectOneMenu>
<h:panelGroup id="containerExtraEnvio">
<h:panelGroup
rendered="#{dIGRCController.digrc.c8tpenvio == 'O' or dIGRCController.digrc.c8tpenvio == 'F'}">
<p:outputLabel for="envioAdicionales" value="Extra" />
<p:inputText id="envioAdicionales"
value="#{dIGRCController.digrc.c8qadi}" required="true"
requiredMessage="You must enter an Extra" />
</h:panelGroup>
</h:panelGroup>
</h:panelGroup>
</p:panelGrid>
</h:form>
Inside the first panelGrid, there is an drop down with ID concept. When an item is selected, this will update the container with ID hiddenSections. If the concept selected is 1, then it should show Money Orders. If the concept is 8, it should show Transfer Documents (see the panelGrid with id hiddenSections).
The image below shows the seven DIV elements that are empty inside. For code clarity, I am only showing two of them (If you wanted to, you should be able to reproduce with two).
Those seven DIV elements represent seven panelGroups that are rendered given the conditions I explained above. When the user first gets to the screen, none of them are rendered because the concept is not yet set. In this case, I see empty spaces which I don't want. How do I get rid of those empty spaces?
In this case, I see empty spaces which I don't want. How do I get rid of those empty spaces?
Your question is vague and I understood it 3 ways ( excuse me if I misunderstood as the answers seems obvious in all cases ).
When a component is not rendered, it doesn't figure in the html at all. So if by empty space you meant space characters then those are outside the tags in question.
If the table generated takes space because of css you want that part to be empty at page load then you can use rendered for that.
I think that one is what you were asking: Since your selectItem is initially null, none of the panelGroup out of the 8 are rendered and you'd like a default one to be rendered when the selected item is at null. Then just include a check to see if the value is empty for your default panelGroup.
Sorry if I misunderstood the question.

<p:selectOneMenu> generates input field behind select box

I'm trying to associate a label tag with my dropdown menu to make it accessible to screen readers. I've noticed that when using p:selectOneMenu primefaces generates an input element that should not be there. When applying p:outputLabel, it appears to work fine (ie you click on the label text and focus moves to the dropdown menu). However it turns out that the focus is in fact moving to the input element and the select element is not keyboard accessible (tabindex="-1"). Here's an example taken from the primefaces website:
http://www.primefaces.org/showcase/ui/input/oneMenu.xhtml
<h:form>
<p:messages autoUpdate="true" />
<h:panelGrid columns="2" style="margin-bottom:10px" cellpadding="5">
<p:outputLabel for="console" value="Basic:" />
<p:selectOneMenu id="console" value="#{selectOneMenuView.console}" style="width:125px">
<f:selectItem itemLabel="Select One" itemValue="" />
<f:selectItem itemLabel="Xbox One" itemValue="Xbox One" />
<f:selectItem itemLabel="PS4" itemValue="PS4" />
<f:selectItem itemLabel="Wii U" itemValue="Wii U" />
</p:selectOneMenu>
<p:outputLabel for="car" value="Grouping: " />
<p:selectOneMenu id="car" value="#{selectOneMenuView.car}">
<f:selectItem itemLabel="Select One" itemValue="" />
<f:selectItems value="#{selectOneMenuView.cars}" />
</p:selectOneMenu>
<p:outputLabel for="city" value="Editable: " />
<p:selectOneMenu id="city" value="#{selectOneMenuView.city}" effect="fold" editable="true">
<f:selectItem itemLabel="Select One" itemValue="" />
<f:selectItems value="#{selectOneMenuView.cities}" />
</p:selectOneMenu>
<p:outputLabel for="advanced" value="Advanced:" />
<p:selectOneMenu id="advanced" value="#{selectOneMenuView.theme}" converter="themeConverter" panelStyle="width:180px"
effect="fade" var="t" style="width:160px" filter="true" filterMatchMode="startsWith">
<f:selectItems value="#{selectOneMenuView.themes}" var="theme" itemLabel="#{theme.displayName}" itemValue="#{theme}" />
<p:column style="width:10%">
<h:outputText styleClass="ui-theme ui-theme-#{t.name}" />
</p:column>
<p:column>
<h:outputText value="#{t.displayName}" />
</p:column>
</p:selectOneMenu>
</h:panelGrid>
<p:commandButton value="Submit" update="display" oncomplete="PF('dlg').show()" icon="ui-icon-check" />
<p:dialog header="Values" modal="true" showEffect="bounce" widgetVar="dlg" resizable="false">
<p:panelGrid columns="2" id="display" columnClasses="label,value">
<h:outputText value="Basic:" />
<h:outputText value="#{selectOneMenuView.console}" />
<h:outputText value="Grouping:" />
<h:outputText value="#{selectOneMenuView.car}" />
<h:outputText value="Editable" />
<h:outputText value="#{selectOneMenuView.city}" />
<h:outputText value="Advanced:" />
<h:outputText value="#{selectOneMenuView.theme.displayName}" />
</p:panelGrid>
</p:dialog>
When you look at the page with just the html loaded, you can see each p:selectOneMenu generates an input as well as a select.
<td>
<label id="j_idt88:j_idt91" class="ui-outputlabel ui-widget" for="j_idt88:console_focus">Basic:</label>
</td>
<div id="j_idt88:console" class="ui-selectonemenu ui-widget ui-state-default ui-corner-all" style="width:125px">
<div class="ui-helper-hidden-accessible">
<input id="j_idt88:console_focus" name="j_idt88:console_focus" type="text" autocomplete="off">
</div>
<div class="ui-helper-hidden-accessible">
<select id="j_idt88:console_input" name="j_idt88:console_input" tabindex="-1" data-p-label="Basic" data-p-hl="onemenu">
<option value="">Select One</option><option value="Xbox One">Xbox One</option>
<option value="PS4">PS4</option>
<option value="Wii U">Wii U</option>
</select>
</div>
<label id="j_idt88:console_label" class="ui-selectonemenu-label ui-inputfield ui-corner-all">Select One</label>
<div class="ui-selectonemenu-trigger ui-state-default ui-corner-right">
<span class="ui-icon ui-icon-triangle-1-s ui-c"></span>
</div>
</div>
I'm looking to have the dropdown menu to behave like the JSF one h:selectOneMenu (when it comes to accessibility). Specific to the example, I want the "Basic:" label associated with it's dropdown menu so that when you click "Basic" focus moves to the dropdown menu. I also want a screen reader to actually treat it as a select element rather than an input element. So far I can't find a way to do this because of that input element that's generated. I'm currently using Primefaces 5.2. Does anyone know a way to prevent this input element from being generated?
I gave up on the p:selectOneMenu for two reasons : it is not accessible and it is a pain to use on a mobile device because it doesn't bring the native control picker (the "spinning wheel" on the iPad for instance).
Instead I use the h:selectOneMenu customized with something like :
<h:selectOneMenu
styleClass="ui-inputfield ui-widget ui-state-default ui-corner-all #{component.valid ? '' : 'ui-state-error'}"
onmouseover="$(this).addClass('ui-state-active')"
onmouseout="$(this).removeClass('ui-state-active')"
onfocus="$(this).addClass('ui-state-active ui-state-focus')"
onblur="$(this).removeClass('ui-state-active ui-state-focus')"/>
It doesn't look that bad, it is accessible and it works well with mobile device.

p:selectOneMenu keeps deselecting

I have a bug, I have in a page, 3 <p:selectOneMenu>s and 1 <p:selectManyMenu>
They work in order, I select the first, it fills the second, the secon fill the third and the third fill s the <p:selectManyMenu>. When I start to Select the values in the <p:selectManyMenu>(holding the ctrl button) the third <p:selectOneMenu> deselects. Executing the function that fills the <p:selectManyMenu>.
Anyone have ever seen this?
I'have a lot of experience with java, but just started with JSF and PrimeFaces.
Thank you all in advance.
<ui:composition 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:p="http://primefaces.org/ui">
<h:form id="formPatch">
<table border="">
<tr>
<td height="180p" valign="top">
<p:panel header="Configurar diretórios para extrair Objetos do Patch" style="width: 500px; height: 170px">
<h:panelGrid columns="2">
<p:outputLabel value="Arquivo: " styleClass="format_label"
for="nomePatch" />
<p:inputText id="nomePatch" value="#{patchMB.patchBean.fileName}" styleClass="format_input" required="true"
requiredMessage="Favor preencher o campo nome do arquivo ex: confg.txt">
</p:inputText>
<p:outputLabel value="Repositórios:" styleClass="format_label" for="dirRep" />
<p:selectOneMenu id="dirRep" value="#{patchMB.patchBean.directoryRepositorio}"
style="width: 350px">
<p:message for="dirRep" />
<f:selectItem itemLabel="Selecione" itemValue="Selecione" />
<f:selectItems value="#{patchMB.directoryRepCli}" />
<f:ajax event="change" listener="#{patchMB.carregaDirProdCli}" render="dirProdCli" />
</p:selectOneMenu>
<p:outputLabel value="Prod/Clientes: " for="dirProdCli" />
<p:selectOneMenu id="dirProdCli" value="#{patchMB.patchBean.directoryProdCli}"
style="width: 350px">
<p:message for="dirGap" />
<f:selectItem itemLabel="Selecione" itemValue="Selecione" />
<f:selectItems value="#{patchMB.dirProdCli}" />
<f:ajax event="change" listener="#{patchMB.carregaDirObjetos}" render="dirObj" />
</p:selectOneMenu>
<p:outputLabel value="Dir objetos: " for="dirObj" />
<p:selectOneMenu id="dirObj" value="#{patchMB.patchBean.directoryObjetos}"
style="width: 350px">
<p:message for="dirObj" />
<f:selectItem itemLabel="Selecione" itemValue="Selecione" />
<f:selectItems value="#{patchMB.dirObjetos}" />
<f:ajax event="change" listener="#{patchMB.carregarFiles}" render="pickListArq" />
<f:ajax event="change" listener="#{patchMB.carregarSelectMany}" render="objSelectMany" />
</p:selectOneMenu>
</h:panelGrid>
</p:panel>
</td>
<td>
<p:panel header="Escolha os arquivos para criação do patch" style="width: 500px">
<p:tab id="pickListTab" title="Transformadores">
<h:panelGrid columns="1">
<p:pickList id="pickListArq" value="#{patchMB.objetos}" var="pickListObj"
itemLabel="#{pickListObj}" itemValue="#{pickListObj}">
<f:facet name="sourceCaption">Selecione os objetos</f:facet>
<f:facet name="targetCaption">Objetos do Patch</f:facet>
</p:pickList>
</h:panelGrid>
</p:tab>
</p:panel>
</td>
</tr>
</table>
</h:form>
</ui:composition>

t:selectOneRadio with a4j:ajax no javascript rendered

I'm creating a dynamic form with radio buttons in front of each rows that need to update a cart when a different row is selected :
<t:inputText id="test">
<f:ajax event="click" onevent="alert('3');" />
</t:inputText>
<t:selectOneRadio id="rbtnQuantity" value="#{orderActions.selectedQuantity}" layout="spread">
<f:selectItems value="#{orderActions.quantities}" var="item" />
<f:converter converterId="integerConverter" />
<a4j:ajax event="click" oncomplete="renderPrices();" />
</t:selectOneRadio>
<rich:dataTable id="tblQuantities" styleClass="quantities" value="#{orderActions.formatQuantityPrices}" var="item" rowKeyVar="row">
<h:column>
<t:radio id="rbtnQuantity" for=":form:rbtnQuantity" index="#{row}" />
</h:column>
<h:column>
<h:outputText value="#{item.quantity}" />
</h:column>
<h:column>
<h:outputText value="#{item.price}">
<f:convertNumber type="currency" currencySymbol="$" />
</h:outputText>
</h:column>
<h:column>
<h:outputText value="#{item.price / item.quantity}">
<f:convertNumber type="currency" currencySymbol="$" />
</h:outputText>/u
</h:column>
</rich:dataTable>
The problem is that no radio button fire the ajax event, even no javascript code is rendered in the resuling code :
<table id="form:tblQuantities" class="rf-dt quantities">
<colgroup span="4">
</colgroup>
<tbody id="form:tblQuantities:tb" class="rf-dt-b">
<tr id="form:tblQuantities:0" class="rf-dt-r rf-dt-fst-r">
<td id="form:tblQuantities:0:j_idt296" class="rf-dt-c">
<label><input id="form:tblQuantities:0:rbtnQuantity" type="radio" name="form:rbtnQuantity" checked="checked" value="25" /> 25</label>
</td>
<td id="form:tblQuantities:0:j_idt297" class="rf-dt-c">25</td>
<td id="form:tblQuantities:0:j_idt309" class="rf-dt-c">118,75 $</td>
<td id="form:tblQuantities:0:j_idt310" class="rf-dt-c">4,75 $/u</td>
</tr>
[more similar rows...]
I've also included one t:inputText at top, see if it was the t:selectOneRadio usage that was the problem but no.
I'm using Mojarra, RichFaces 4.2.1, Tomahawk 1.1.14.
Since I've not been able to use a4j:ajax or f:ajax with t:selectOneRadio, I've used this workaround :
<a4j:jsFunction name="changeQuantity" oncomplete="renderPrices();">
<a4j:param assignTo="#{orderActions.selectedQuantity}" name="quantity" />
</a4j:jsFunction>
<t:selectOneRadio onclick="quantity = jQuery(this).val();changeQuantity(quantity);" id="rbtnQuantity" value="#{orderActions.selectedQuantity}" layout="spread">
<f:selectItems value="#{orderActions.quantities}" var="item" />
<f:converter converterId="integerConverter" />
</t:selectOneRadio>
It is working properly, but I would prefer to fix the problem if ever someone find the right solution or I.
EDIT :
Here is the final used code :
<a4j:jsFunction name="changeQuantity" oncomplete="renderPrices();">
<a4j:param assignTo="#{orderActions.selectedQuantity}" name="quantity" />
</a4j:jsFunction>
# Each row of the table :
<input type="radio" name="quantity" value="#{item.quantity}" checked="#{orderActions.selectedQuantity eq item.quantity ? 'checked' : ''}" onclick="changeQuantity(#{item.quantity});" />

<p:fileUpload> hide the following component

I am using JSF2,primefaces2.1 (using netbeans 7.0.1 and glassfish3.1)
the problem that i am facing from a while is after using the the button below it dont appear(if I add component below the fileupload it's ok but not after!)
after a lot of observing I have remarked that the problem is when I remove the table(which I have use it to organize my components) the button (adduser) appear !
this is the code page.xhtml
<table border="1" align="center" style='width:1004px;height:100px;' cellpadding="0" cellspacing="0" >
<h:form>
<tr><td>
<h:outputLabel value="Nom" /><h:inputText value="#{AddPerson.nom}" />
<br /></td></tr>
<tr><td> <h:outputLabel value="Prenom"/> <h:inputText value="#{AddPerson.prenom}" />
<br /></td></tr>
<tr><td> <h:outputLabel value="Etat Civil"/>
<h:selectOneMenu id="etatcivil" value="#{AddPerson.etatCivil}">
<f:selectItem itemValue="Monsieur" itemLabel="M"/>
<f:selectItem itemValue="Madam" itemLabel="Mme"/>
<f:selectItem itemValue="Madmoiselle" itemLabel="Mlle"/>
</h:selectOneMenu>
<br /></td></tr>
<tr><td> <h:outputLabel value="Date de naissance "/>
<h:selectOneMenu id="jour" value="#{AddPerson.jour}">
<f:selectItem itemValue="00" itemLabel=""/>
<f:selectItem itemValue="01" itemLabel="01"/> <f:selectItem itemValue="02" itemLabel="02"/><f:selectItem itemValue="03" itemLabel="03"/>
<f:selectItem itemValue="04" itemLabel="04"/><f:selectItem itemValue="05" itemLabel="05"/><f:selectItem itemValue="06" itemLabel="06"/>
<f:selectItem itemValue="07" itemLabel="07"/><f:selectItem itemValue="08" itemLabel="08"/><f:selectItem itemValue="09" itemLabel="09"/>
<f:selectItem itemValue="10" itemLabel="10"/><f:selectItem itemValue="11" itemLabel="11"/><f:selectItem itemValue="12" itemLabel="12"/>
<f:selectItem itemValue="13" itemLabel="13"/><f:selectItem itemValue="14" itemLabel="14"/><f:selectItem itemValue="15" itemLabel="15"/>
<f:selectItem itemValue="16" itemLabel="16"/><f:selectItem itemValue="17" itemLabel="17"/><f:selectItem itemValue="18" itemLabel="18"/>
<f:selectItem itemValue="19" itemLabel="19"/><f:selectItem itemValue="20" itemLabel="20"/><f:selectItem itemValue="21" itemLabel="21"/>
<f:selectItem itemValue="22" itemLabel="22"/><f:selectItem itemValue="23" itemLabel="23"/><f:selectItem itemValue="24" itemLabel="24"/>
<f:selectItem itemValue="25" itemLabel="25"/><f:selectItem itemValue="26" itemLabel="26"/><f:selectItem itemValue="27" itemLabel="27"/>
<f:selectItem itemValue="28" itemLabel="28"/><f:selectItem itemValue="29" itemLabel="29"/><f:selectItem itemValue="30" itemLabel="30"/>
<f:selectItem itemValue="31" itemLabel="31"/>
</h:selectOneMenu>
<h:selectOneMenu id="mois" value="#{AddPerson.mois}">
<f:selectItem itemValue="00" itemLabel=""/>
<f:selectItem itemValue="01" itemLabel="Janvier"/> <f:selectItem itemValue="02" itemLabel="Fevrier"/><f:selectItem itemValue="03" itemLabel="Mars"/>
<f:selectItem itemValue="04" itemLabel="Avril"/><f:selectItem itemValue="05" itemLabel="May"/><f:selectItem itemValue="06" itemLabel="Juin"/>
<f:selectItem itemValue="07" itemLabel="Juillet"/><f:selectItem itemValue="08" itemLabel="Aout"/><f:selectItem itemValue="09" itemLabel="Septembre"/>
<f:selectItem itemValue="10" itemLabel="Octobre"/><f:selectItem itemValue="11" itemLabel="Novembre"/><f:selectItem itemValue="12" itemLabel="Decembre"/>
</h:selectOneMenu>
<h:selectOneMenu id="annee" value="#{AddPerson.annee}" >
<f:selectItem itemValue="1940" itemLabel="1940"/> <f:selectItem itemValue="1941" itemLabel="1941"/><f:selectItem itemValue="1942" itemLabel="1942"/><f:selectItem itemValue="1943" itemLabel="1943"/><f:selectItem itemValue="1944" itemLabel="1944"/><f:selectItem itemValue="1945" itemLabel="1945"/><f:selectItem itemValue="1946" itemLabel="1946"/><f:selectItem itemValue="1947" itemLabel="1947"/><f:selectItem itemValue="1948" itemLabel="1948"/><f:selectItem itemValue="1949" itemLabel="1949"/>
<f:selectItem itemValue="1950" itemLabel="1950"/><f:selectItem itemValue="1951" itemLabel="1951"/><f:selectItem itemValue="1952" itemLabel="1952"/><f:selectItem itemValue="1953" itemLabel="1953"/><f:selectItem itemValue="1954" itemLabel="1954"/><f:selectItem itemValue="1955" itemLabel="1955"/><f:selectItem itemValue="1956" itemLabel="1956"/><f:selectItem itemValue="1957" itemLabel="1957"/><f:selectItem itemValue="1958" itemLabel="1958"/><f:selectItem itemValue="1959" itemLabel="1959"/>
<f:selectItem itemValue="1960" itemLabel="1960"/><f:selectItem itemValue="1961" itemLabel="1961"/><f:selectItem itemValue="1962" itemLabel="1962"/><f:selectItem itemValue="1963" itemLabel="1963"/><f:selectItem itemValue="1964" itemLabel="1964"/><f:selectItem itemValue="1965" itemLabel="1965"/><f:selectItem itemValue="1966" itemLabel="1966"/><f:selectItem itemValue="1967" itemLabel="1967"/><f:selectItem itemValue="1968" itemLabel="1968"/><f:selectItem itemValue="1969" itemLabel="1969"/>
<f:selectItem itemValue="1970" itemLabel="1970"/><f:selectItem itemValue="1971" itemLabel="1971"/><f:selectItem itemValue="1972" itemLabel="1972"/><f:selectItem itemValue="1973" itemLabel="1973"/><f:selectItem itemValue="1974" itemLabel="1974"/><f:selectItem itemValue="1975" itemLabel="1975"/><f:selectItem itemValue="1976" itemLabel="1976"/><f:selectItem itemValue="1977" itemLabel="1977"/><f:selectItem itemValue="1978" itemLabel="1978"/><f:selectItem itemValue="1979" itemLabel="1979"/>
<f:selectItem itemValue="1980" itemLabel="1980"/><f:selectItem itemValue="1981" itemLabel="1981"/><f:selectItem itemValue="1982" itemLabel="1982"/><f:selectItem itemValue="1983" itemLabel="1983"/><f:selectItem itemValue="1984" itemLabel="1984"/><f:selectItem itemValue="1985" itemLabel="1985"/><f:selectItem itemValue="1986" itemLabel="1986"/><f:selectItem itemValue="1987" itemLabel="1987"/><f:selectItem itemValue="1988" itemLabel="1988"/><f:selectItem itemValue="1989" itemLabel="1989"/>
<f:selectItem itemValue="1990" itemLabel="1990"/><f:selectItem itemValue="1991" itemLabel="1991"/><f:selectItem itemValue="1992" itemLabel="1992"/><f:selectItem itemValue="1993" itemLabel="1993"/><f:selectItem itemValue="1994" itemLabel="1994"/><f:selectItem itemValue="1995" itemLabel="1995"/><f:selectItem itemValue="1996" itemLabel="1996"/><f:selectItem itemValue="1997" itemLabel="1997"/><f:selectItem itemValue="1998" itemLabel="1998"/><f:selectItem itemValue="1999" itemLabel="1999"/>
<f:selectItem itemValue="2000" itemLabel="2000"/><f:selectItem itemValue="2001" itemLabel="2001"/><f:selectItem itemValue="2002" itemLabel="2002"/><f:selectItem itemValue="2003" itemLabel="2003"/><f:selectItem itemValue="2004" itemLabel="2004"/><f:selectItem itemValue="2005" itemLabel="2005"/><f:selectItem itemValue="2006" itemLabel="2006"/><f:selectItem itemValue="2007" itemLabel="2007"/><f:selectItem itemValue="2008" itemLabel="2008"/><f:selectItem itemValue="2009" itemLabel="2009"/>
<f:selectItem itemValue="2010" itemLabel="2010"/><f:selectItem itemValue="2011" itemLabel="2011"/><f:selectItem itemValue="2012" itemLabel="2012"/>
</h:selectOneMenu>
</td></tr>
<tr><td> <br /> <h:outputLabel value="fax"/><h:inputText value="#{AddPerson.fax}" /></td></tr>
<tr><td> <br /> <h:outputLabel value="profession"/><h:inputText value="#{AddPerson.profession}" /></td></tr>
<tr><td> <br /> <h:outputLabel value="adresse"/><h:inputText value="#{AddPerson.adresse}" /></td></tr>
<tr><td> <br /> <h:outputLabel value="code Postal"/><h:inputText value="#{AddPerson.codePostal}" /></td></tr>
<tr><td> <br /> <h:outputLabel value="Domaine de Competence"/>
<h:selectOneMenu value="#{AddPerson.domain}" id="domaine" >
<f:selectItem itemLabel="-- Select Domaine de Competence-- " itemValue="0"/>
<f:selectItems value="#{AddPerson.listDomaine}" />
</h:selectOneMenu></td></tr>
<tr style="width:800px"><td style="width:500px"> <br /> <h:outputLabel value="Files"/>
<h:panelGroup style="display:inline;color:yellow;">
<p:fileUpload style="display:inline" fileUploadListener="#{AddPerson.fileUpload}"
sizeLimit="500000"
allowTypes="/(\.|\/)(gif|jpe?g|png)$/"/>
</h:panelGroup></td></tr>
<tr><td> <br /> <h:outputLabel value="butt"/> <h:commandButton style="color:red;" value="Add User" action="#{AddPerson.addUserDB}" /></td></tr>
</h:form></table>
Have you tried replacing table with <h:panelGrid ? Or with ul and li (different styling approaches than plain table ?
In my case check the Chrome element inspector and saw the default css Primefaces and I appeared so:
.ui-fileupload {
display: none;
}
What I did is overwrite the style in my css file like this:
.ui-fileupload {
display: inline;
}
Info:
http://www.mkyong.com/jsf2/primefaces/how-to-override-primefaces-css/

Resources