How to display contents in reverse order in <h:dataTable> - jsf-2

I am accepting data in Array and displaying it in the same screen using <h:dataTable>.
How can display contents in reverse order, i.e. show the latest entry in the first row?
Below is code can i display nonDox.non_List in reverse order
<h:body>
<h:panelGroup rendered="#{not empty dataBase}">
<h:form id="nonDoxScanForm">
<f:event listener="#{nonDox.validate_AccNo}" type="postValidate" />
<table border="0" class="InnerBox" width="55%">
<tr><th colspan="7" align="Center" class="clsTitle">Non Dox Add</th></tr>
<tr>
<td>Delivery Date</td>
<td >Consginee (F2) </td>
<td>Weight (F3)</td>
<td>SubBranch Code(F4)</td>
<td >Consignment No (F10)</td>
<td align="Center">(F12)</td>
</tr>
<tr>
<td> <p:calendar value="#{nonDox.delDate}" id="fDat" /> </td>
<td><h:inputText size="20" id="fcon" value="#{nonDox.consignee}" /> </td>
<td><h:inputText size="20" id="fweig" value="#{nonDox.weight}" >
</h:inputText> </td>
<td><h:inputText size="20" id="fsub" value="#{nonDox.subBranchCode}" >
<f:validateLength maximum="3"></f:validateLength>
</h:inputText> </td>`enter code here`
<td><h:inputText size="10" id="acno" value="#{nonDox.accNo}" onfocus="this.select()" >
</h:inputText>
</td>
<td> <h:commandButton value="Add" id="fAdd" action="#{nonDox.addAction}" onclick="return validate();" />
</td>
<td> <h:commandButton value="Save" action="#{nonDox.saveAction}" >
</h:commandButton>
</td>
</tr>
<tr>
<td colspan="7">
<h:message for="acno"/>
</td>
</tr>
</table>
<h:dataTable value="#{ nonDox.non_List}" var="o"
styleClass="order-table"
headerClass="order-table-header"
rowClasses="order-table-odd-row,order-table-even-row" width="55%"
>
<h:column>
<f:facet name="header">Del Date</f:facet>
#{o.cor_Date.substring(0, 10)}
</h:column>
<h:column>
<f:facet name="header">consignee</f:facet>
#{o.consignee}
</h:column>
<h:column>
<f:facet name="header">Weight</f:facet>
#{o.weight}
</h:column>
<h:column>
<f:facet name="header">Rate</f:facet>
#{o.rate}
</h:column>
<h:column>
<f:facet name="header">subBranchCode</f:facet>
#{o.subBranchCode}
</h:column>
<h:column>
<f:facet name="header" >POD No</f:facet>
#{o.accNo}
</h:column>
<h:column>
<f:facet name="header">Action</f:facet>
<h:commandLink value="Delete" action="#{nonDox.deleteAction(o)}" />
</h:column>
</h:dataTable>
</h:form>
<h:panelGroup >
<h:panelGroup rendered="#{empty dataBase}">
<h1>Session Expired</h1>
<h:link outcome="Login" target="CommonContent" >Login</h:link>
</h:panelGroup>
</h:body>

If you're using an List as in new ArrayList<Item>(), it's easy: use Collections#reverse():
private List<Item> data;
#PostConstruct
public void init() {
data = service.list();
Collections.reverse(data);
}
// ...
Just reference it in <h:dataTable value="#{bean.data}"> the usual way.
If you're using an array as in Item[], then you'd need to convert it to List first with help of Arrays#asList(), so that you can feed it to Collections#reverse():
private List<Item> data;
#PostConstruct
public void init() {
Item[] items = service.array();
data = Arrays.asList(items);
Collections.reverse(data);
}
// ...
Or just rewrite the service method in such way that you don't need to perform this conversion step in the backing bean.
Key is, you shouldn't expect to perform this job in the view. You should just prepare the model in such way that it's exactly as what the view expects. The <h:dataTable> itself doesn't provide any facilities like that.

Related

Am working on ViewScoped annotation in jsf but am not getting correct output

I am working on #ViewScoped annotation in JSF2.0. Below is the code what I had written. It is not working as I expected. Please review it and let me know if any changes are required to get the exact output that what am thinking of.
Here is my Controller SearchController.java
package com.s2tech.jsfapp.controllers;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import com.s2tech.jsfapp.helper.SearchHelper;
import com.s2tech.jsfapp.managedbean.SearchManagedBean;
#ManagedBean(name ="searchController")
#ViewScoped
public class SearchController implements Serializable{
public SearchController(){
private static final long serialVersionUID = 1L;
SearchHelper searchHelper;
private List<SearchManagedBean> employeeList=new ArrayList<SearchManagedBean>();
public List<SearchManagedBean> getEmployeeList() {
return employeeList;
}
public void setEmployeeList(List<SearchManagedBean> employeeList) {
this.employeeList = employeeList;
}
public void getEmployee(SearchManagedBean searchManagedBean) {
searchHelper=new SearchHelper();
employeeList = searchHelper.getEmployee(searchManagedBean);
//return "search.xhtml";
//return Constants.searchPage;
// return null;
}
Below is my view search.xhtml
<h:body style="background-color:skyblue;">
<ui:include src="mainMenu.xhtml"></ui:include>
<h:form prependId="false">
<table>
<tr style="display:block;margin-top:10px;width:100%;margin-left:40%">
<td style="width:40%">
<p:outputLabel for="firstName" value="First Name:" style="font-weight:bold" />
<p:inputText id="firstName" value="#{searchManagedBean.firstName}" required="true" requiredMessage="please enter First Name"> </p:inputText>
<p:message id="firstNameMsg" for="firstName" showDetail="true" ></p:message>
</td>
<td style="width: 20%"></td>
<td style="width:40%;">
<p:outputLabel for="lastName" value="Last Name:" style="font-weight:bold"/>
<p:inputText id="lastName" value="#{searchManagedBean.lastName}" required="true" requiredMessage="please enter Last Name" />
<p:message id="lastNameMsg" for="lastName" showDetail="true" ></p:message>
</td>
</tr>
<tr style="display:block;margin-top:10px;width:100%;margin-left:78%">
<td style="width:40%"> <p:commandButton value="Search" action="#{searchController.getEmployee(searchManagedBean)}" update="firstNameMsg lastNameMsg emailMsg phoneMsg dataTable"/></td>
</tr>
</table>
</h:form>
<p:dataTable id="dataTable" var="emp" rendered="#{not empty searchController.employeeList}" value="#{searchController.employeeList}" rowStyleClass="table table-striped table-hover table-bordered" resizableColumns="true" resizeMode="expand" scrollWidth="50%" scrollHeight="150" >
<p:column headerText="First Name">
<h:outputText value="#{emp.firstName}"/>
</p:column>
<p:column headerText="Last Name">
<h:outputText value="#{emp.lastName}"/>
</p:column>
<p:column headerText="Email">
<h:outputText value="#{emp.email}"/>
</p:column>
<p:column headerText="Phone">
<h:outputText value="#{emp.phone}"/>
</p:column>
<p:column headerText="Edit">
<p:commandLink value="Edit" action="#{searchController.getEditForm(emp)}" style="margin-left:40px;color:blue;"></p:commandLink>
</p:column>
</p:dataTable>
</h:body>
</html>
My question is that after entering first name and last name, when I click on submit button it need to hit controller's getEmployee() method and it needs to display data table values from controller's getEmployeeList(). Here eventhough using ViewScoped bean Iam not getting output. Any suggestions??

Update the tabview when select the row in datatable

In the below code i can update the tabview when i select the row in datatable.but here is one small problem is the editor in one of my tab is disable when select a row and the downlod is not working in first time if u click second time it will work correctly
<p:dataTable id="dataCall" var="call" value="#{calllist.mediumCallsModel}"
selection="#{calllist.selectedCall}" scrollRows="20" scrollHeight="350"
scrollWidth="150" liveScroll="true" selectionMode="single" paginator="true" rows="5"
widgetVar="callsTable" paginatorPosition="bottom" paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" rowsPerPageTemplate="5,10,20,50">
<p:ajax event="rowSelect" listener="#{calllist.onRowSelect}" update=":MyListForm:showlist: :MyListForm:growl " />
<p:ajax event="rowUnselect" listener="#{calllist.onRowUnselect}" update=":MyListForm:growl"/>
<p:column headerText="Call ID">
<h:outputText value="#{call.callId}"/>
</p:column>
<p:column headerText="Created By">
<h:outputText value="#{call.createdBy}" />
</p:column>
<p:column headerText="Location">
<h:outputText value="#{call.location}" />
</p:column>
<p:column headerText="Status">
<h:outputText value="#{call.status}" />
</p:column>
<p:column headerText="Product">
<h:outputText value="#{call.product}" />
</p:column>
<p:column headerText="Module">
<h:outputText value="#{call.module}" />
</p:column>
<p:column headerText="Group Assigned">
<h:outputText value="#{call.groupAssigned}" />
</p:column>
<p:column headerText="Assigned to">
<h:outputText value="#{call.assignedTo}" />
</p:column>
<p:column headerText="Call creation">
<h:outputText value="#{call.callCreation}" />
</p:column>
</p:dataTable>
<h:panelGrid >
<p:tabView id="showlist" cache="true" style="font-size: 15px; height: 260px;width: 995px">
<p:tab id="tab1" title="Call Details">
<p:fieldset id="calldetails" style="background-color: lightgray; font-weight: bold;color: black;">
<table border="0" width="900px" align="left" style="font-size: 12px">
<tr>
<td width="100px"><h:outputText value="Status:"/></td>
<td width="80px"><p:selectOneMenu id="status" value="#{calllist.selectedCall.statusId}" style="width:114px; font-size: 12px">
<f:selectItem itemLabel="Select Status" itemValue="-1" />
<f:selectItems value="#{calllist.dyStatusList}" />
</p:selectOneMenu> </td>
</tr>
</table>
</p:fieldset>
</p:tab>
<p:tab title="Work log/Comments">
<table id="comment_table" width="900px" height="200px" border="0" style="font-size: 12px;">
<tr valign="top">
<td>
<div id="oldcomment" style="width:450px; height: 90px; background-color:lightgray;font-weight: bold;color: black;overflow: scroll;">
<ui:repeat value="#{calllist.oldComments}" var="item">
<table>
<tr>
<td><h:outputText value="User ID"/></td>
<td><h:outputText value="#{item.modifiedUserID}"/></td>
</tr>
</table>
<hr/>
</ui:repeat>
</div>
<div id="comment" style="width:450px; height: 90px; background-color:lightgray; font-weight: bold;color: black;" >
</div>
</td>
<td>
<p:editor id="editor" width="400" height="190" onchange="append_comment();" value="#{calllist.comments}"/>
</td>
</tr>
</table>
</p:tab>
<p:tab title="Attachments">
<h:form id="download_form">
<table id="download_list">
<tr>
<td>
<p:fileUpload id="upload" fileUploadListener="#{calllist.handleFileUpload}" mode="advanced" sizeLimit="100000" multiple="true" allowTypes="/(\.|\/)(gif|jpe?g|png|xls)$/" />
</td>
<td>
<p:selectOneListbox id="scroll" value="#{calllist.fileName}" style="width: 250px;">
<f:selectItem itemLabel="Select" itemValue="-1"/>
<f:selectItems value="#{calllist.attachment}"/>
</p:selectOneListbox>
</td>
</tr>
<tr>
<td></td>
<td align="center">
<p:commandButton id="downloadLink" value="Download" ajax="false" icon="ui-icon-arrowthick-1-s">
<p:fileDownload value="#{calllist.file}"/>
</p:commandButton>
</td>
</tr>
</table>
</h:form>
</p:tab>

p:commandButton does not work in the last ajax request

I have to Tab in selectoneButton as "request" and "archive". In that tab I have information that is called with ajax. In that information I need to have a button As "acceptCommonButton" and "noNowCommonButton" so when a User clicks on the "acceptCommonButton" button it calls the "acceptRequest" method. When a user Clicks on "noNowCommonButton" button it calls to "notNowRequest" method.
My problem is that the Button Works until the last request is in "archive" Tab. It means that when the last request is in "request" tab my Button does not work. it's too Weird!!!!
I think the problem here is caused by DataGrid.
could you please see my Code?!!
<table style="width: 100%">
<tr>
<td>
<p:selectOneButton value="#{inviteRequestManagedBean.filterType}">
<f:selectItem itemLabel="#{inviteRequest_msg.request}" itemValue="request"/>
<f:selectItem itemLabel="#{inviteRequest_msg.archive}" itemValue="archive" />
<f:ajax event="change" render="requestDataGrid" />
</p:selectOneButton>
</td>
</tr>
<tr>
<td>
<p:dataGrid id="requestDataGrid" var="tBusinessPartnerRequestInfo"
value="#{inviteRequestManagedBean.filterBusinessRequest()}" columns="1" rows="22" >
<p:column>
<div>
<table border="0" width="100%">
<tr>
<td>
<p:graphicImage value="#{tBusinessPartnerRequestInfo.partySender_imageUrl}"/>
</td>
<td>
<div>
<table border="0" width="100%">
<tr>
<td>
<h:outputLabel value="#{tBusinessPartnerRequestInfo.requestDate}"/>
</td>
</tr>
<tr>
<td>
<h:outputLabel value="#{tBusinessPartnerRequestInfo.partySender_fullName}"/>
</td>
</tr>
</table>
</div>
</td>
<td>
<p:commandButton id="acceptCommonButton" value="#{inviteRequest_msg.accept}"
actionListener="#{inviteRequestManagedBean.acceptRequest(tBusinessPartnerRequestInfo.id)}"
update="#form" process="#form">
</p:commandButton>
</td>
<td>
<p:commandButton id="noNowCommonButton" value="#{inviteRequest_msg.notnow}"
actionListener="#{inviteRequestManagedBean.notNowRequest(tBusinessPartnerRequestInfo.id)}"
update="#form" process="#form">
</p:commandButton>
</td>
<td>
<p:panel>
<p:ajaxStatus>
<f:facet name="start">
<p:graphicImage value="../resources/img/loading.gif"/>
</f:facet>
<f:facet name="complete">
<h:outputLabel value=""/>
</f:facet>
</p:ajaxStatus>
</p:panel>
</td>
</tr>
</table>
</div>
<hr/>
</p:column>
</p:dataGrid>
<p:panel>
</p:panel>
</td>
</tr>
</table>

Primefaces poll not updating panel

I can't figure out why my primefaces poll will not update any components.
<p:poll widgetVar="poll"
interval="#{messageBean.refreshInterval}"
listener="#{messageBean.refreshLiveData}"
update=":transactionLogForm:tabViewMain:liveViewPanel"/>
The refreshLiveData method gets called successfully but it refuses to update the outputText component (or any component for that matter).
<p:tab id="liveViewTab" title="Live View">
<h:panelGrid id="liveViewPanel" columns="6" cellpadding="5">
<h:outputText value="Live View Enabled: " />
<p:selectBooleanCheckbox value="#{messageBean.liveViewActive}">
</p:selectBooleanCheckbox>
<h:outputText value="Interval: " />
<p:spinner id="interval" value="#{transactionLogBean.refreshInterval}" />
<h:outputText value="Last Update:" />
<h:outputText id="lastUpdated" value="#{transactionLogBean.lastUpdated}" />
</h:panelGrid>
</p:tab>
Here is the full code from within the body tags:
<p:layout id="mainLayout" fullPage="true" style="height:100%" >
<h:form id="transactionLogForm">
<p:poll widgetVar="poll"
interval="#{messageBean.refreshInterval}"
listener="#{messageBean.refreshLiveData}"
update=":transactionLogForm:tabViewGrids:messageTable :transactionLogForm:tabViewGrids:timestatTable :transactionLogForm:tabViewMain:liveViewPanel"/>
<p:layoutUnit id="topHeader" position="north" size="178" >
<ui:include src="inc_menu.xhtml" />
</p:layoutUnit>
<p:layoutUnit id="center" position="center" >
<div>
<p style="font-size: 20px; font-weight: bold; padding: 0px 0px 0px 10px">Transaction Logs</p>
</div>
<p:tabView id="tabViewMain" orientation="top">
<p:tab title="Reference No">
<h:panelGrid columns="2" cellpadding="5">
<p:inputTextarea id="referenceNo" rows="1" cols="100" value="#{transactionBean.referenceNo}" style="width:300px"/>
<p:commandButton id="refreshBtnMain0" value="Search" action="#{transactionBean.searchTranLogDetails(true)}"
update=":transactionLogForm:transactionSearchTable" ajax="true"
oncomplete="txnDialog.show()"
style="vertical-align: baseline"/>
</h:panelGrid>
</p:tab>
<p:tab title="Log Id">
<h:panelGrid columns="2" cellpadding="5">
<p:inputText id="logID" value="#{transactionLogBean.logID}" style="width:300px"/>
<p:commandButton id="refreshBtnMain1" value="Refresh" action="#{transactionLogBean.refreshData}" update=":transactionLogForm:tabViewGrids:messageTable :transactionLogForm:tabViewGrids:timestatTable" ajax="true" />
</h:panelGrid>
</p:tab>
<p:tab title="Date Range">
<h:panelGrid columns="5" cellpadding="5">
<h:outputText value="Start Date:" />
<p:calendar id="StartDate" pattern="dd/MM/yyyy HH:mm:ss" navigator="true" value="#{transactionLogBean.startDate}" />
<h:outputText value="End Date:" />
<p:calendar id="EndDate" pattern="dd/MM/yyyy HH:mm:ss" navigator="true" value="#{transactionLogBean.endDate}" />
<p:commandButton id="refreshBtnMain2" value="Refresh" action="#{transactionLogBean.refreshData}" update=":transactionLogForm:tabViewGrids:messageTable :transactionLogForm:tabViewGrids:timestatTable" ajax="true" />
</h:panelGrid>
</p:tab>
<p:tab id="liveViewTab" title="Live View">
<h:panelGrid id="liveViewPanel" columns="6" cellpadding="5">
<h:outputText value="Live View Enabled: " />
<p:selectBooleanCheckbox value="#{messageBean.liveViewActive}">
</p:selectBooleanCheckbox>
<h:outputText value="Interval: " />
<p:spinner id="interval" value="#{transactionLogBean.refreshInterval}" />
<h:outputText value="Last Update:" />
<h:outputText id="lastUpdated" value="#{transactionLogBean.lastUpdated}" />
</h:panelGrid>
</p:tab>
</p:tabView>
<p:tabView id="tabViewGrids">
<p:tab title="Message Logs">
<ui:include src="inc_messagelogs.xhtml" />
</p:tab>
<p:tab title="Timestat Logs">
<ui:include src="inc_timestatlogs.xhtml" />
</p:tab>
</p:tabView>
<p:dialog header="Log Message" widgetVar="logDialog" id="logDlg" showEffect="fade">
<h:outputText id="msg" value="#{transactionLogBean.selectedLogMessage}"/>
</p:dialog>
<p:dialog header="Transaction Search Results" widgetVar="txnDialog" resizable="false" id="tranDlg"
showEffect="fade" modal="false" position="center">
<p:dataTable id="transactionSearchTable" value="#{transactionBean.tranlogList}"
var="t" widgetVar="tranSearchTable" rowKey="#{t.transactionId}"
selectionMode="single" selection="#{transactionBean.selectedTranlog}"
paginator="true" rows="10" style="font-size:14px"
rowStyleClass="#{t.rowColour}">
<p:ajax event="rowSelect" update=":transactionLogForm:tabViewGrids:messageTable :transactionLogForm:tabViewGrids:timestatTable"
listener="#{transactionLogBean.refreshData(transactionBean.selectedTranlog.logId)}"
oncomplete="txnDialog.hide()" global="false"/>
<p:column style="text-align: left">
<f:facet name="header">
Tran Id
</f:facet>
#{t.transactionId}
</p:column>
<p:column style="text-align: left" sortBy="#{t.dateCreated}">
<f:facet name="header">
Date/Time
</f:facet>
#{t.dateCreated}
</p:column>
<p:column style="text-align: left" sortBy="#{t.transactionType}">
<f:facet name="header">
Tran Type
</f:facet>
#{t.transactionType}
</p:column>
<p:column style="text-align: left">
<f:facet name="header">
Amount
</f:facet>
#{t.amount}
</p:column>
<p:column style="text-align: left">
<f:facet name="header">
Result
</f:facet>
#{t.externalMessageCode}
</p:column>
</p:dataTable>
</p:dialog>
</p:layoutUnit>
</h:form>
</p:layout>
I'm not getting any errors reported, so all the references must be ok - please help!!!
I'm using JSF 2.0, Primefaces 3.4.RC1
Extract from generated html:
<div id="transactionLogForm:tabViewMain:liveViewTab" class="ui-tabs-panel ui-widget-content ui-corner-bottom ui-helper-hidden" role="tabpanel" aria-hidden="true"><table id="transactionLogForm:tabViewMain:liveViewPanel" cellpadding="5">
<tbody>
<tr>
<td>Live View Enabled: </td>
<td><div id="transactionLogForm:tabViewMain:j_idt27" class="ui-chkbox ui-widget"><div class="ui-helper-hidden-accessible"><input id="transactionLogForm:tabViewMain:j_idt27_input" name="transactionLogForm:tabViewMain:j_idt27_input" type="checkbox" /></div><div class="ui-chkbox-box ui-widget ui-corner-all ui-state-default"><span class="ui-chkbox-icon"></span></div></div><script id="transactionLogForm:tabViewMain:j_idt27_s" type="text/javascript">PrimeFaces.cw('SelectBooleanCheckbox','widget_transactionLogForm_tabViewMain_j_idt27',{id:'transactionLogForm:tabViewMain:j_idt27'});</script></td>
<td>Interval: </td>
<td><span id="transactionLogForm:tabViewMain:interval" class="ui-spinner ui-widget ui-corner-all"><input id="transactionLogForm:tabViewMain:interval_input" name="transactionLogForm:tabViewMain:interval_input" type="text" class="ui-spinner-input ui-inputfield ui-state-default ui-corner-all" autocomplete="off" value="10" /><a class="ui-spinner-button ui-spinner-up ui-corner-tr ui-button ui-widget ui-state-default ui-button-text-only"><span class="ui-button-text"><span class="ui-icon ui-icon-triangle-1-n"></span></span></a><a class="ui-spinner-button ui-spinner-down ui-corner-br ui-button ui-widget ui-state-default ui-button-text-only"><span class="ui-button-text"><span class="ui-icon ui-icon-triangle-1-s"></span></span></a></span><script id="transactionLogForm:tabViewMain:interval_s" type="text/javascript">$(function(){PrimeFaces.cw('Spinner','widget_transactionLogForm_tabViewMain_interval',{id:'transactionLogForm:tabViewMain:interval',step:1.0});});</script></td>
<td>Last Update:</td>
<td><span id="transactionLogForm:tabViewMain:lastUpdated"></span></td>
</tr>
</tbody>
</table>
</div>
Problem solved - it was a backing bean issue after all and had nothing to do with the poll itself which was working fine.

A component which is hidden by another JSF/primefaces

hello,
I'am using JSF/primefaces 2.0
My problem is that I can't see the button "Add User" in the page,I think the problem is caused by the balise p:fileUpload because when I delete it I can see the button!!
<table border="1" align="center" cellpadding="0" cellspacing="0" width="1000" heighth="1800">
<tr>
<td>
<h:form>
<table border="0" align="center" cellpadding="0" cellspacing="0" width="600">
<tr> <td> <h:outputLabel style="font-size: 13px" value="Nom" /> </td><td><h:inputText value="#{AddPerson.nom}" /></td></tr>
<tr><td> <h:outputLabel value="Files"/></td><td><p:fileUpload fileUploadListener="#{AddPerson.fileUpload}" update="messages" sizeLimit="500000" allowTypes="/(\.|\/)(gif|jpe?g|png)$/"/> </td></tr>
<tr><td> <h:commandButton action="#{AddPerson.addUserDB}" value="Add User" /> </td></tr>
</table>
</h:form>
</td>
</tr>
</table>
The whole code:
<body>
<table border="1" style='width:auto;height:100px;' align="center" cellpadding="0" cellspacing="0" >
<tr><td>
<table border="1" style='width:auto;height:100px;' align="center" cellpadding="0" cellspacing="0" >
<tr >
<td><h:graphicImage width="100" url="/ONST.jpg"/> </td>
<td >
<h:graphicImage width="900" url="/banner_home.jpg" />
</td>
</tr>
</table>
<br></br><br></br><br></br>
<table border="1" align="center" style='width:auto;height:100px;' cellpadding="0" cellspacing="0" >
<tr>
<td>
<h:form>
<table border="1" style='width:auto;height:100px;' align="center" cellpadding="1" cellspacing="1" >
<tr> <td> <h:outputLabel style="font-size: 13px" value="Nom" /> </td><td><h:inputText value="#{AddPerson.nom}" /></td></tr>
<tr> <td> <h:outputLabel value="Prenom"/></td><td> <h:inputText value="#{AddPerson.prenom}" /></td></tr>
<tr> <td> <h:outputLabel value="Etat Civil"/></td>
<td> <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>
</td></tr>
<tr>
<td><h:outputLabel value="Date de naissance "/> </td>
<td>
<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><h:outputLabel value="email"/></td><td><h:inputText value="#{AddPerson.email}" /></td></tr>
<tr><td> <h:outputLabel value="numTelephone"/></td><td><h:inputText value="#{AddPerson.numTelephone}" /></td></tr>
<tr> <td> <h:outputLabel value="mobile"/></td><td><h:inputText value="#{AddPerson.mobile}" /></td></tr>
<tr><td> <h:outputLabel value="fax"/></td><td><h:inputText value="#{AddPerson.fax}" /></td></tr>
<tr><td> <h:outputLabel value="profession"/></td><td><h:inputText value="#{AddPerson.profession}" /></td></tr>
<tr><td> <h:outputLabel value="adresse"/></td><td><h:inputText value="#{AddPerson.adresse}" /></td></tr>
<tr><td> <h:outputLabel value="code Postal"/></td><td><h:inputText value="#{AddPerson.codePostal}" /></td></tr>
<tr><td> <h:outputLabel value="Ville"/></td><td><h:inputText value="#{AddPerson.ville}" /></td></tr>
<tr><td> <h:outputLabel value="Pays"/></td><td><h:inputText value="#{AddPerson.pays}" /></td></tr>
<tr><td> <h:outputLabel value="Domaine de Competence"/></td>
<td> <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><td><h:outputLabel value="login"/></td><td><h:inputText value="#{AddPerson.login}" /></td></tr>
<tr><td> <h:outputLabel value="password"/></td><td><h:inputText value="#{AddPerson.password}" /></td></tr>
<tr><td> <h:outputLabel value="Files"/></td> <td> <h:panelGroup style="display:inline-block"> <p:fileUpload fileUploadListener="#{AddPerson.fileUpload}" update="messages" sizeLimit="500000" allowTypes="/(\.|\/)(gif|jpe?g|png)$/" /></h:panelGroup></td></tr>
<tr><td> </td><td> <h:commandButton type="submit" value="Add User" action="#{AddPerson.addUserDB}" /> </td></tr>
</table>
</h:form>
</td>
</tr>
</table>
</td></tr></table>
</body>
Sorry, but I cannot reproduce your problem.
This is how your given code looks in FF 11 (and similar in IE9 and Chrome 18):
Maybe you have a stylesheet included somewhere else on your page that hides the button somehow..

Resources