ViewScoped bean losing its state after clicking a commandLink - jsf-2

I'm using Icefaces 3.2 along with JSF 2.1.8. I have the below views included in the main xhtml page. It looks like myViewBean which is #ViewScoped is losing it's state after the link myLink is clicked. The actionListener has logic to get the myViewBean and set the required list of items. During the render response phase, the myViewBean seems to have empty empList. If the #ViewScoped is changed to #SessionScoped, it works in the expected way, but I have 10 other beans all of which need to be changed to SessionScoped. What makes the bean lose its state? Or is there any other way to make use of ViewScoped?
main.xhtml
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ice="http://www.icesoft.com/icefaces/component"
xmlns:ui="http://java.sun.com/jsf/facelets" >
<f:view contentType="text/html">
<h:head>
</h:head>
<h:body id="bodyId" bgcolor="white">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<ice:panelGroup>
<ice:form id="mainForm" name="mainForm">
<table>
<tbody>
<tr>
<td>
<ui:include src="myTabs.xhtml"/>
</td>
</tr>
</tbody>
</table>
</ice:form>
</ice:panelGroup>
</td>
</tr>
</table>
</h:body>
</f:view>
</html>
myTabs.xhtml
<f:subview
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ice="http://www.icesoft.com/icefaces/component"
xmlns:ui="http://java.sun.com/jsf/facelets">
<div>
<table class="icePnlTbSet" id="myTabSet"
border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td>
<table cellpadding="0" cellspacing="0">
<tbody>
<tr>
<!-- My Tab 1 -->
<td class="icePnlTb" style="vertical-align: bottom;" title="tab1">
<table cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="LftTop"><img alt="" src="/images/spacer.gif "
width="4" height="1" /></td>
<td class="MidTop"><img alt="" src="/images/spacer.gif "
width="4" height="1" /></td>
<td class="RtTop"><img alt="" src="/images/spacer.gif "
width="4" height="1" /></td>
</tr>
<tr>
<td class="LftMid"><img alt="" src="/images/spacer.gif "
width="4" height="1" /></td>
<td class="MidMid">
<ice:commandLink id="myLink" value="MyTab 1" title=""
actionListener="#{mySessionBean.tabChanged}">
<f:param value="0" name="tab" />
</ice:commandLink>
</td>
<td class="RtMid"><img alt="" src="/images/spacer.gif "
width="4" height="1" /></td>
</tr>
<tr>
<td class="LftBtm"><img alt="" src="/images/spacer.gif "
width="4" height="1" /></td>
<td class="MidBtm"><img alt="" src="/images/spacer.gif "
width="4" height="1" /></td>
<td class="RtBtm"><img alt="" src="/images/spacer.gif "
width="4" height="1" /></td>
</tr>
</tbody>
</table>
</td>
<!-- Repeat for n tabs -->
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
<ui:include src="tabcontent1.xhtml" />
</f:subview>
tabcontent1.xhtml
<f:subview
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ice="http://www.icesoft.com/icefaces/component"
xmlns:ui="http://java.sun.com/jsf/facelets">
<ice:panelGroup>
<ice:dataTable id="empTable" value="#{myViewBean.empList}"
var="emp">
...
</ice:dataTable>
</ice:panelGroup>
</f:subview>

A #ViewScoped bean will only hold data if you return null or void from action methods (which will navigate back to the same page), once you navigate away from the view the data is lost.
May be you can try #RequestScoped.

Related

JellyException: Could not parse Jelly script : null

I'm trying to configure some features in Jenkins for our project. In the process of configuring Editable Email Notification, I have created a new jelly script file in $JENKINS_HOME/email-templates folder as shown here
<j:choose>
<j:when test="${build.result=='SUCCESS'}">
<IMG SRC="${rooturl}static/test1.gif" />
</j:when>
<j:when test="${build.result=='FAILURE'}">
<IMG SRC="${rooturl}static/e59dfe28/images/32x32/red.gif" />
</j:when>
<j:otherwise>
<IMG SRC="${rooturl}static/e59dfe28/images/32x32/yellow.gif" />
</j:otherwise>
</j:choose>
and accessing it in Jenkins config like this
${JELLY_SCRIPT,template="groovy-html"}
When I build the job, with these setting, I'm getting email with the content
"JellyException: Could not parse Jelly script : null"
Please find below script jelly script.
Thanks in advance!!
<?jelly escape-by-default='true'?>
<!DOCTYPE html [
<!ENTITY nbsp "&#38;nbsp;">
]>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define">
<STYLE>
BODY, TABLE, TD, TH, P {
font-family:Verdana,Helvetica,sans serif;
font-size:11px;
color:black;
}
h1 { color:black; }
h2 { color:black; }
h3 { color:black; }
TD.bg1 { color:white; background-color:#0000C0; font-size:120% }
TD.bg2 { color:white; background-color:#4040FF; font-size:110% }
TD.bg3 { color:white; background-color:#8080FF; }
TD.test_passed { color:blue; }
TD.test_failed { color:red; }
TD.console { font-family:Courier New; }
</STYLE>
<BODY>
<!-- GENERAL INFO -->
<TABLE>
<TR><TD align="right">
<j:choose>
<j:when test="${build.result=='SUCCESS'}">
<IMG SRC="${rooturl}static/test1.gif" />
</j:when>
<j:when test="${build.result=='FAILURE'}">
<IMG SRC="${rooturl}static/e59dfe28/images/32x32/red.gif" />
</j:when>
<j:otherwise>
<IMG SRC="${rooturl}static/e59dfe28/images/32x32/yellow.gif" />
</j:otherwise>
</j:choose>
</TD><TD valign="center"><B style="font-size: 200%;">QTP Execution - ${build.result}</B></TD></TR>
<TR><TD>Execution URL</TD><TD>${rooturl}${build.url}</TD></TR>
<TR><TD>Project:</TD><TD>${project.name}</TD></TR>
<TR><TD>Date of Execution:</TD><TD>${it.timestampString}</TD></TR>
<TR><TD>Execution duration:</TD><TD>${build.durationString}</TD></TR>
</TABLE>
<BR/>
<!-- CHANGE SET -->
<j:set var="changeSet" value="${build.changeSet}" />
<j:if test="${changeSet!=null}">
<j:set var="hadChanges" value="false" />
<TABLE width="100%">
<TR><TD class="bg1" colspan="2"><B>CHANGES</B></TD></TR>
<j:forEach var="cs" items="${changeSet}" varStatus="loop">
<j:set var="hadChanges" value="true" />
<j:set var="aUser" value="${cs.hudsonUser}"/>
<TR>
<TD colspan="2" class="bg2"> Revision <B>${cs.commitId?:cs.revision?:cs.changeNumber}</B> by
<B>${aUser!=null?aUser.displayName:cs.author.displayName}: </B>
<B>(${cs.msgAnnotated})</B>
</TD>
</TR>
<j:forEach var="p" items="${cs.affectedFiles}">
<TR>
<TD width="10%"> ${p.editType.name}</TD>
<TD>${p.path}</TD>
</TR>
</j:forEach>
</j:forEach>
<j:if test="${!hadChanges}">
<TR><TD colspan="2">No Changes</TD></TR>
</j:if>
</TABLE>
<BR/>
</j:if>
<!-- ARTIFACTS -->
<j:set var="artifacts" value="${build.artifacts}" />
<j:if test="${artifacts!=null and artifacts.size()>0}">
<TABLE width="100%">
<TR><TD class="bg1"><B>LOG FILES</B></TD></TR>
<TR>
<TD>
<j:forEach var="f" items="${artifacts}">
<li>
${f}
</li>
</j:forEach>
</TD>
</TR>
</TABLE>
<BR/>
</j:if>
<!-- Email Content -->
<TABLE width="100%">
<TR><TD align="right">
<j:choose>
<j:when test="${build.result=='SUCCESS'}">
<TR><TD class="bg1"><B>Please find attached FIle Differences sheet and Logs. If there are any unexpected file differences then please investigate further.</B></TD></TR>
</j:when>
<j:when test="${build.result=='FAILURE'}">
<TR><TD class="bg1"><B>Something went wrong. Please check log file for more details and if required then restart the execution after making appropriate changes.</B></TD></TR>
</j:when>
<j:otherwise>
<TR><TD class="bg1"><B>Please contact Jenkins Administrator.</B></TD></TR>
</j:otherwise>
</j:choose>
</TABLE>
<BR/>
<!-- MAVEN ARTIFACTS -->
<j:set var="mbuilds" value="${build.moduleBuilds}" />
<j:if test="${mbuilds!=null}">
<TABLE width="100%">
<TR><TD class="bg1"><B>BUILD ARTIFACTS</B></TD></TR>
<j:forEach var="m" items="${mbuilds}">
<TR><TD class="bg2"><B>${m.key.displayName}</B></TD></TR>
<j:forEach var="mvnbld" items="${m.value}">
<j:set var="artifacts" value="${mvnbld.artifacts}" />
<j:if test="${artifacts!=null and artifacts.size()>0}">
<TR>
<TD>
<j:forEach var="f" items="${artifacts}">
<li>
${f}
</li>
</j:forEach>
</TD>
</TR>
</j:if>
</j:forEach>
</j:forEach>
</TABLE>
<BR/>
</j:if>
<!-- JUnit TEMPLATE -->
<j:set var="junitResultList" value="${it.JUnitTestResult}" />
<j:if test="${junitResultList.isEmpty()!=true}">
<TABLE width="100%">
<TR><TD class="bg1" colspan="2"><B>JUnit Tests</B></TD></TR>
<j:forEach var="junitResult" items="${it.JUnitTestResult}">
<j:forEach var="packageResult" items="${junitResult.getChildren()}">
<TR><TD class="bg2" colspan="2"> Name: ${packageResult.getName()} Failed: ${packageResult.getFailCount()} test(s), Passed: ${packageResult.getPassCount()} test(s), Skipped: ${packageResult.getSkipCount()} test(s), Total: ${packageResult.getPassCount()+packageResult.getFailCount()+packageResult.getSkipCount()} test(s)</TD></TR>
<j:forEach var="failed_test" items="${packageResult.getFailedTests()}">
<TR bgcolor="white"><TD class="test_failed" colspan="2"><B><li>Failed: ${failed_test.getFullName()} </li></B></TD></TR>
</j:forEach>
</j:forEach>
</j:forEach>
</TABLE>
<BR/>
</j:if>
<!-- COBERTURA TEMPLATE -->
<j:set var="coberturaAction" value="${it.coberturaAction}" />
<j:if test="${coberturaAction!=null}">
<j:set var="coberturaResult" value="${coberturaAction.result}" />
<j:if test="${coberturaResult!=null}">
<table width="100%"><TD class="bg1" colspan="2"><B>Cobertura Report</B></TD></table>
<table width="100%"><TD class="bg2" colspan="2"><B>Project Coverage Summary</B></TD></table>
<table border="1px" class="pane">
<tr>
<td>Name</td>
<j:forEach var="metric" items="${coberturaResult.metrics}">
<td>${metric.name}</td>
</j:forEach>
</tr>
<tr>
<td>${coberturaResult.name}</td>
<j:forEach var="metric" items="${coberturaResult.metrics}">
<td data="${coberturaResult.getCoverage(metric).percentageFloat}">${coberturaResult.getCoverage(metric).percentage}%
(${coberturaResult.getCoverage(metric)})
</td>
</j:forEach>
</tr>
</table>
<j:if test="${coberturaResult.sourceCodeLevel}">
<h2>Source</h2>
<j:choose>
<j:when test="${coberturaResult.sourceFileAvailable}">
<div style="overflow-x:scroll;">
<table class="source">
<thead>
<tr>
<th colspan="3">${coberturaResult.relativeSourcePath}</th>
</tr>
</thead>
${coberturaResult.sourceFileContent}
</table>
</div>
</j:when>
<j:otherwise>
<p>
<i>Source code is unavailable</i>
</p>
</j:otherwise>
</j:choose>
</j:if>
<j:forEach var="element" items="${coberturaResult.childElements}">
<j:set var="childMetrics" value="${coberturaResult.getChildMetrics(element)}"/>
<table width="100%"><TD class="bg2" colspan="2">Coverage Breakdown by ${element.displayName}</TD></table>
<table border="1px" class="pane sortable">
<tr>
<td>Name</td>
<j:forEach var="metric" items="${childMetrics}">
<td>${metric.name}</td>
</j:forEach>
</tr>
<j:forEach var="c" items="${coberturaResult.children}">
<j:set var="child" value="${coberturaResult.getChild(c)}"/>
<tr>
<td>
${child.xmlTransform(child.name)}
</td>
<j:forEach var="metric" items="${childMetrics}">
<j:set var="childResult" value="${child.getCoverage(metric)}"/>
<j:choose>
<j:when test="${childResult!=null}">
<td data="${childResult.percentageFloat}">${childResult.percentage}%
(${childResult})
</td>
</j:when>
<j:otherwise>
<td data="101">N/A</td>
</j:otherwise>
</j:choose>
</j:forEach>
</tr>
</j:forEach>
</table>
</j:forEach>
</j:if>
<BR/>
</j:if>
<!-- CONSOLE OUTPUT -->
<j:getStatic var="resultFailure" field="FAILURE" className="hudson.model.Result"/>
<j:if test="${build.result==resultFailure}">
<TABLE width="100%" cellpadding="0" cellspacing="0">
<TR><TD class="bg1"><B>CONSOLE OUTPUT</B></TD></TR>
<j:forEach var="line" items="${build.getLog(100)}"><TR><TD class="console">${line}</TD></TR></j:forEach>
</TABLE>
<BR/>
</j:if>
</BODY>
</j:jelly>

Not able to show committers list in Jenkins Jelly email template

We have recently migrated our jenkins to 1.6 version and I have findbug project set. While showing findbug results in email using below jelly template, "Find Bugs warnings info" section shows error message as "Find Bugs Publisher did not get invoked due to an error". But I do not see any error in console.
Also, "New Warnings" section is not showing up. It looks that fb variable is null and no results are showing up in email template.
Even the change sets section is not visible.
Is there any setting missing for findbug in Jenkins required to show up these results.
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define">
<html>
<head>
<title>${project.name}</title>
<style>
body table, td, th, p, h1, h2 {
margin:0;
font:normal normal
90% Georgia, Serif;
background-color: #ffffff;
}
h1, h2 {
border-bottom:dotted 1px #999999;
padding:5px;
margin-top:10px;
margin-bottom:10px;
color: #000000;
font: normal bold 90%
Georgia,Serif;
background-color:#f0f0f0;
}
</style>
</head>
<body>
<div class="header">
<j:set var="spc" value="&nbsp;&nbsp;" />
<h1>
<j:choose>
<j:when test="${build.result=='SUCCESS'}">
<img src="${rooturl}static/e59dfe28/images/32x32/blue.gif" />
</j:when>
<j:when test="${build.result=='FAILURE'}">
<img src="${rooturl}static/e59dfe28/images/32x32/red.gif" />
</j:when>
<j:otherwise>
<img
src="${rooturl}static/e59dfe28/images/32x32/yellow.gif" />
</j:otherwise>
</j:choose>
BUILD ${build.result}
</h1>
<table>
<tr>
<td>Build URL</td>
<td>
${rooturl}${build.url}
</td>
</tr>
<tr>
<td>Project:</td>
<td>${project.name}</td>
</tr>
<tr>
<td>Date of build:</td>
<td>${it.timestampString}</td>
</tr>
<tr>
<td>Build duration:</td>
<td>${build.durationString}</td>
</tr>
<tr>
<td>Build cause:</td>
<td>
<j:forEach var="cause" items="${build.causes}">${cause.shortDescription}
</j:forEach>
</td>
</tr>
<tr>
<td>Build description:</td>
<td>${build.description}</td>
</tr>
<tr>
<td>Built on:</td>
<td>
<j:choose>
<j:when test="${build.builtOnStr!=''}">${build.builtOnStr}
</j:when>
<j:otherwise>master</j:otherwise>
</j:choose>
</td>
</tr>
</table>
</div>
<!-- Static Analysis -->
<j:set var="actions" value="${it.staticAnalysisActions}" />
<j:if test="${!actions.isEmpty()}">
<div class="content">
<h1>Static Analysis Results</h1>
<table>
<tr>
<th></th>
<th>Name</th>
<th>Result</th>
<th>Total</th>
<th>High</th>
<th>Normal</th>
<th>Low</th>
</tr>
<j:forEach var="action" items="${actions}">
<tr>
<td>
<img src="${rooturl}${action.smallImageName}" />
</td>
<td>
<a href="${rooturl}${build.url}/${action.urlName}">${action.displayName}
</a>
</td>
<td class="center">
<j:choose>
<j:when test="${action.result.pluginResult=='SUCCESS'}">
<img src="${rooturl}static/e59dfe28/images/16x16/blue.gif" />
</j:when>
<j:when test="${action.result.pluginResult=='FAILURE'}">
<img src="${rooturl}static/e59dfe28/images/16x16/red.gif" />
</j:when>
<j:otherwise>
<img src="${rooturl}static/e59dfe28/images/16x16/yellow.gif" />
</j:otherwise>
</j:choose>
</td>
<td class="center">${action.result.numberOfAnnotations}
</td>
<td class="center">${action.result.getNumberOfAnnotations('HIGH')}
</td>
<td class="center">${action.result.getNumberOfAnnotations('NORMAL')}
</td>
<td class="center">${action.result.getNumberOfAnnotations('LOW')}
</td>
</tr>
</j:forEach>
</table>
</div>
</j:if>
<!-- More Find bugs info-->
<j:set var="fb" value="${it.getAction('hudson.plugins.findbugs.FindBugsResultAction')}" />
<div class="content">
<h1>Find Bugs warnings info</h1>
<table width="100%">
<tr>
<th>Total</th>
<th>Fixed</th>
<th>New</th>
<th >Report</th>
</tr>
<tr>
<td class="center">${fb.result.numberOfWarnings}</td>
<td class="center">${fb.result.numberOfFixedWarnings}</td>
<td class="center">${fb.result.numberOfNewWarnings}</td>
<td class="center">View Report</td>
</tr>
</table>
</div>
<j:set var="newWarnings" value="${fb.result.newWarnings}" />
<j:if test="${newWarnings!=null}">
<div class="content">
<h1>New warnings</h1>
<table width="100%" class="newWarningsborder">
<tr>
<th width="20%" class="newWarningsborder">Name</th>
<th width="5%" class="newWarningsborder">Line</th>
<th width="*" class="newWarningsborder">Message</th>
</tr>
<j:forEach var="fileAnnotation" items="${newWarnings}" varStatus="loop">
<tr>
<td width="20%" class="newWarningsborder">${fileAnnotation.shortFileName}</td>
<td width="5%" class="newWarningsborder">${fileAnnotation.primaryLineNumber}</td>
<td width="*" class="newWarningsborder">${fileAnnotation.message}</td>
</tr>
</j:forEach>
</table>
</div>
</j:if>
<!-- CHANGE SET -->
<div class="content">
<j:set var="changeSet" value="${build.changeSet}" />
<j:if test="${changeSet!=null}">
<j:set var="hadChanges" value="false" />
<a href="${rooturl}${build.url}/changes">
<h1>Changes</h1>
</a>
<j:forEach var="cs" items="${changeSet.logs}" varStatus="loop">
<j:set var="hadChanges" value="true" />
<h2>${cs.msgAnnotated}</h2>
<p>
by
<em>${cs.author}</em>
</p>
<table>
<j:forEach var="p" items="${cs.affectedFiles}">
<tr>
<td width="10%">${spc}${p.editType.name}</td>
<td>
<tt>${p.path}</tt>
</td>
</tr>
</j:forEach>
</table>
</j:forEach>
<j:if test="${!hadChanges}">
<p>No Changes</p>
</j:if>
<br />
</j:if>
</div>
<!-- ARTIFACTS -->
<j:set var="artifacts" value="${build.artifacts}" />
<j:if test="${artifacts!=null and artifacts.size()>0}">
<div class="content">
<h1>Build Artifacts</h1>
<ul>
<j:forEach var="f" items="${artifacts}">
<li>
${f}
</li>
</j:forEach>
</ul>
</div>
</j:if>
<!-- MAVEN ARTIFACTS -->
<j:set var="mbuilds" value="${build.moduleBuilds}" />
<j:if test="${mbuilds!=null}">
<div class="content">
<h1>Build Artifacts</h1>
<j:forEach var="m" items="${mbuilds}">
<h2>${m.key.displayName}</h2>
<j:forEach var="mvnbld" items="${m.value}">
<j:set var="artifacts" value="${mvnbld.artifacts}" />
<j:if test="${artifacts!=null and artifacts.size()>0}">
<ul>
<j:forEach var="f" items="${artifacts}">
<li>
${f}
</li>
</j:forEach>
</ul>
</j:if>
</j:forEach>
</j:forEach>
<br />
</div>
</j:if>
</body>
</html>

rich:popupPanel with <a4j:status> is not working in JSF2

When i hit on Submit button rich popup panel is not working.Should it be outside the h:form or inside . I tried both ways but it is not working. Please help me where i am going wrong .Below is my code.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:fn="http://java.sun.com/jsp/jstl/functions"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">
<h:body>
<ui:composition template="/pages/layout.xhtml">
<ui:define name="heading">
<h:outputText value="Paging” </h:outputText>
</ui:define>
<ui:define name="content">
<h:panelGrid id="panel2">
<h:form id="my_form">
<table>
<tr>
<td>
<h:panelGroup id="globalmessages">
<h:message id="key1" for="key" style="color:red" showDetail="true" />
<h:message id="lock1" for="lock" errorStyle ="color:red" showDetail="true" />
</h:panelGroup>
</td>
</tr>
</table>
<table width="700px" >
<tr>
<td align="right" width="30%"><label>Files: </label></td>
<td align="left" width="70%"><h:outputText value= "Hosting file" /></td>
</tr>
<tr>
<td align="right" width="30%"><label for="lastdate">
Last Date:</label></td>
<td align="left" width="70%"><h:panelGrid id="panel1">
<h:panelGroup>
<rich:calendar id=" lastdate "
value="#{myBean.ladate}"
locale="Locale.US" popup="true" datePattern="MM/dd/yyyy"
showApplyButton="false" todayControlMode = "hidden" cellWidth="24px" cellHeight="220px"
enableManualInput = "true" converterMessage = "Entered wrong date format"
style="width:200px" required="true" requiredMessage="Last date: is required."/>
(MM/DD/YYYY)
</h:panelGroup>
</h:panelGrid>
<h:commandButton value ="getHost" action="#{mybean.hosted}" id="key" />
</td>
</tr>
<tr></tr><tr></tr><tr></tr><tr></tr>
<tr>
<td align="right" width="30%"><label>Data: </label></td>
<td align="left" width="70%"><h:inputText id="datarelated" value="#{myBean.dataExist}" style="padding-bottom: 68px; width: 165px;"/></td>
</tr>
<tr></tr><tr></tr><tr></tr>
<tr>
<td align="right">
<a4j:commandButton value ="SubmitVal" action="#{myBean.onVal}" id="lock" style="height: 25px; width: 90px;"
render="globalmessages" status="ajaxStatus"/>
</td>
</tr>
</table>
</h:form>
<a4j:status name="ajaxStatus"
onstart="#{rich:component('waitPanel')}.show('',{top:'340px', left:'450px',height:'50px', width:'350px'})"
onstop="#{rich:component('waitPanel')}.hide()" >
</a4j:status>
<rich:popupPanel id="waitPanel" style="text-align:center">
<h:form id="test">
<h:outputText value="Please wait...Calculating" style="font-weight:bold;font-size:large" />
</h:form>
</rich:popupPanel>
</h:panelGrid>
</ui:define>
</ui:composition>
</h:body>
</html>

tabindex doesn't work on p:selectOneMenu or h:SelectOneMenu

Tabindex attribute is not working on p:selectOneMenu that I am using in my page. I also have h:inputtext on the same page for which tabindex works fine.
I am using primefaces 4.0. Please help. After the 2nd tabindex it gets lost.
<!-- This Dialog page is being used for both ADD & EDIT APPLICANT functionality -->
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:ui="http://java.sun.com/jsf/facelets">
<h:form id="addApplicantForm">
<div class="panel" style="width: 540px;">
<p:outputPanel id="critTabPanel" >
<div class="dlgHeader">#{applicantForITCController.action} Applicant</div>
<table width="100%" border="0" cellspacing="5px" style="font-size: 12px">
<tr>
<td style="width:30%">First Name:</td>
<td style="width:65%;padding-right: 5px" align="right">
<h:inputText id="firstName-input" styleClass="suburbinput round5 applyInput" value="#{applicantForITCController.applicantForITCInfo.firstName}"
required="true" requiredMessage="First Name required" onkeypress="return fnb.pl.events.KeyEvents.isStringKey(event)" maxlength="50" tabindex="1"/>
<p:watermark for="firstName-input" value="Enter First Name" />
</td>
<td style="width:5%">
<p:message for="firstName-input" id="msg-firstName-input" display="icon" />
</td>
</tr>
<tr>
<td style="width:30%">Last Name:</td>
<td style="width:65%;padding-right: 5px" align="right">
<h:inputText id="lastName-input" styleClass="suburbinput round5 applyInput" value="#{applicantForITCController.applicantForITCInfo.lastName}"
onkeypress="return fnb.pl.events.KeyEvents.isStringKey(event)" maxlength="50" required="true" requiredMessage="Last Name required" tabindex="2"/>
<p:watermark for="lastName-input" value="Enter Last Name" />
</td>
<td style="width:5%">
<p:message for="lastName-input" id="msg-lastName-input" display="icon" />
</td>
</tr>
<tr>
<td style="width:30%">Identity Type:</td>
<td style="width:65%;">
<div class="contGeneric">
<div class="colRight">
<div class="fnbDropMenu">
<p:selectOneMenu id="cri-idType" value="#{applicantForITCController.applicantForITCInfo.idType}"
required="true" requiredMessage="Please select an Identity Type" styleClass="selectOnDialog" tabindex="3">
<f:selectItem itemLabel="Please select" itemValue=" " noSelectionOption="true" />
<f:selectItems value="#{applicantForITCController.idTypes}" var="idTy" itemLabel="#{idTy.desc}" itemValue="#{idTy}"/>
<f:validator for="idTypeValidator"
binding="#{za.co.fnb.propertyleader.interfaces.ui.web.validator.IDTypeValidator}"/>
<f:attribute name="idNum" value="#{idNum}" />
</p:selectOneMenu>
</div>
</div>
</div>
</td>
<td style="width:5%">
<p:message for="cri-idType" id="msg-idType" display="icon" />
</td>
</tr>
<tr>
<td style="width:30%">ID/Passport No:</td>
<td style="width:65%;padding-right: 5px" align="right">
<h:inputText id="idNumber" binding="#{idNum}" styleClass="suburbinput round5 applyInput" value="#{applicantForITCController.applicantForITCInfo.idNumber}"
required="true" requiredMessage="ID/Passport Number required" maxlength="30" tabindex="4"/>
<p:watermark for="idNumber" value="Enter ID/Passport Number" />
</td>
<td style="width:5%">
<p:message for="idNumber" id="msg-idNumber" display="icon" />
</td>
</tr>
<tr>
<td style="width:30%">Cell Number:</td>
<td style="width:65%;padding-right: 5px" align="right">
<h:inputText id="cellNo" styleClass="suburbinput round5 applyInput" value="#{applicantForITCController.applicantForITCInfo.cellNo}"
required="true" requiredMessage="Cell Number required" onkeydown="return fnb.pl.events.KeyEvents.isNumericKey(event)" maxlength="10" tabindex="5"/>
<p:watermark for="cellNo" value="Enter Cell Number" />
</td>
<td style="width:5%">
<p:message for="cellNo" id="msg-cellNo" display="icon" />
</td>
</tr>
</table>
</p:outputPanel>
<div class="btnHolder dblExtraForgotPass" align="center" style="padding-top: 15px;">
<a id="colorboxCloseBtn2" class="btn InActive"
href="javascript:addApplicantDialog.hide();"><span>Cancel</span></a>
<p:commandLink process="#this #parent" update=":#{p:component('applicantForITCTbl')} :#{p:component('confirmAppPanel')}
:#{p:component('critTabPanel')} :#{p:component('msgPnl1')}"
action="#{applicantForITCController.updateApplicantForItcList}" styleClass="btn InActive"
oncomplete="fnb.pl.property.handleAddApplicantComplete(xhr, status, args)">
<span>Save</span>
</p:commandLink>
</div>
</div>
</h:form>
</ui:composition>

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>

Resources