In my main page, I have a tool bar which contains some command buttons and links. Also I have a datatable that shows some vehicles data. The command buttons defined in the tool bar do not work properly. When I press the button, the action method is executed after 30-40 seconds later. What should be the cause of this problem?
Here is the tool bar:
<p:toolbar height="30" switchType="client">
<p:toolbarGroup align="left">
<p:commandButton value="#{general.refresh}" icon="ui-icon-refresh" style="font-size:11px;"
action="#{mainPage.refreshPage}" update="vehicleTable" ajax="false"/>
<p:commandButton value="#{general.service}" icon="ui-icon-wrench" style="font-size:11px;"/>
<p:commandButton value="#{general.customerPointsShort}" icon="ui-icon-pin-s" style="font-size:11px;"
title="#{general.customerPoints}"/>
<p:commandButton value="#{general.filtering}" icon="ui-icon-search" style="font-size:11px;"/>
<p:commandButton value="#{general.maximizeMap}" icon="ui-icon-arrow-4-diag" style="font-size:11px;"/>
<p:commandButton title="#{general.showOnTeleAtlas}" icon="teleAtlasLogo" style="font-size:11px;"/>
<p:commandButton title="#{general.showOnGoogleMap}" icon="googleLogo" style="font-size:11px;"/>
</p:toolbarGroup>
<p:toolbarGroup align="right">
<h:outputText id="totalVhclId" value="#{general.totalVhclNumber} : #{mainPage.totalVhclNumber}" styleClass="coloredText1"/>
<p:separator/>
<h:outputText id="workingVhclId" value="#{general.totalWorkingVhclNumber} : #{mainPage.totalWorkingVhclNumber}" styleClass="coloredText1"/>
<p:separator/>
<h:outputText id="activeVhclId" value="#{general.totalActiveVhclNumber} : #{mainPage.totalActiveVhclNumber}" styleClass="coloredText1"/>
<p:separator/>
<h:outputText id="passiveVhclId" value="#{general.totalPassiveVhclNumber} : #{mainPage.totalPassiveVhclNumber}" styleClass="coloredText1"/>
</p:toolbarGroup>
</p:toolbar>
"refreshPage" method:
public void refreshPage(){
selectedDate = "";
totalMWD = "";
totalDWD = "";
errorMessages = "";
selectedVehicle = null;
if(checked.size() > 0)
checked.clear();
getVehicleList();
}
Sometimes it occurs when the server is in debug mode. Check whether you are not running the app in debug mode.
Related
I am using PF 5.0, JSF 2.0 (Mojarra), Spring Webflow 2.3. I am facing multiple issues with the Datatable Lazy loading.
a.) When I try to have Multiple Select for Columns with Lazy Data Model for the DataTable component, When I enable single select for Data table , it works fine .
b.) Another issue that I am facing with the Datatable is that I am unable to load dynamic columns with Lazy Data table , It used to work fine for the non-Lazy version.
Any suggestions to resolve these issues are welcome. Please find the code below.
<p:dataTable id="docsTable" var="document"
value="#{datasource}" lazy="true" paginator="true" dynamic="true"
rows="#{searchActionBean.maxRows}" paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
rowsPerPageTemplate="10,25,50,100" rowKey="#{document.ID}"
sortMode="single" resizableColumns="true" scrollable="true" scrollHeight="350" >
<f:facet name="header">
<p:toolbar>
<f:facet name="left">
<p:commandButton type="button" title="Print" icon="ui-icon-print" />
<span class="ui-separator">
<span class="ui-icon ui-icon-grip-dotted-vertical" />
</span>
<p:commandButton id="reptoggler" value="Reports" action="reportsAction" icon="ui-icon-note">
<f:param name="stdReportName" value="reportsMain" />
</p:commandButton>
</f:facet>
<f:facet name="right">
<h:outputText value="#{searchActionBean.domainName}" />(<h:outputText value="#{searchActionBean.resultCount}" />)
<span class="ui-separator">
<span class="ui-icon ui-icon-grip-dotted-vertical" />
</span>
<h:commandLink>
<img src="${request.contextPath}/images/excel.png" width="15" height="15" />
<p:dataExporter type="xls" target="docsTable" fileName="documents" />
</h:commandLink>
<span class="ui-separator">
<span class="ui-icon ui-icon-grip-dotted-vertical" />
</span>
<h:commandLink>
<img src="${request.contextPath}/images/pdf.png" width="15" height="15"/>
<p:dataExporter type="pdf" target="docsTable" fileName="documents" />
</h:commandLink>
<span class="ui-separator">
<span class="ui-icon ui-icon-grip-dotted-vertical" />
</span>
<p:commandButton id="toggler" type="button" value="Columns" icon="ui-icon-calculator" />
<p:columnToggler datasource="docsTable" trigger="toggler" />
</f:facet>
</p:toolbar>
</f:facet>
<p:column selectionMode="multiple" style="text-align:center; width:25px">
<f:facet name="header">
<h:outputText value="Select" />
</f:facet>
</p:column>
<p:columns value="#{searchResultsColumns}" var="column" styleClass="wrap" width="#{column.width}" columnIndexVar="colIndex" sortBy="#{document[column.pfResColumnName]}" filterBy="#{document[column.pfResColumnName]}">
<f:facet name="header">
<h:outputText value="#{column.displayResultColumnName}" />
</f:facet>
<h:outputText value="#{document[column.pfResColumnName]}" rendered="#{column.resColumnType eq 'DATE'}">
<f:convertDateTime pattern="MM/dd/yyyy" />
</h:outputText>
<h:outputText value="#{document[column.pfResColumnName]}" rendered="#{column.resColumnType eq null}" />
<h:outputText value="#{document[column.pfResColumnName]}" rendered="#{column.resColumnType eq 'SPL'}">
<f:converter converterId="gov.nih.nci.ctep.idart.converters.SplConverter"></f:converter>
</h:outputText>
</p:columns>
</p:dataTable>
And the Bean code, I have verified that the Collections searchResultColumns is not empty.
public class SearchActionBean extends LazyDataModel<DocumentResultDTO> implements Serializable
{
private List<DocumentResultDTO> datasource;
#Override
public DocumentResultDTO getRowData(String rowKey) {
for (DocumentResultDTO doc : datasource) {
if (doc.getID().equals(rowKey))
return doc;
}
return null;
}
#Override
public Object getRowKey(DocumentResultDTO doc) {
return doc.getID();
}
#Override
public List<DocumentResultDTO> load(int first, int pageSize, String sortField,
SortOrder sortOrder, Map<String, Object> filters) {
datasource = new ArrayList<DocumentResultDTO>();
/*this.execute();*/
commonQueriesLocal = ejbService.getCommonQueriesLocal();
srchDelegate = new SearchDelegate();
super.setSearchDelegate(srchDelegate);
try
{
//Set the visibility of all the columns depending on the JQuery table visibility setting from the client side
String invisibleColNames = request.getParameter("invisibleColNames");
ArrayList<UserResultColumnDTO> dispCols = getDisplayColumns();
ApplicationUtils.markVisibilityForColumns(dispCols,invisibleColNames);
int iSortColumnIndex = 1;
String sSortDirection = sortOrder.toString().equalsIgnoreCase("ASCENDING") ? "asc" : "desc";
if(request.getParameter("iSortCol_0") != null)
iSortColumnIndex = Integer.parseInt(request.getParameter("iSortCol_0"));
Query query =
(Query) request.getSession().getAttribute(IdartWebGlobalConstants.USER_QUERY);
if(request.getSession().getAttribute("executeSavedQuery") != null &&
request.getSession().getAttribute("executeSavedQuery").toString().equalsIgnoreCase("true")
)
pageSize = query.getUserQuery().getPageCount();
else
query.getUserQuery().setPageCount(pageSize);
query.getUserQuery().setSortOrder(sSortDirection);
setDataSortColumn(iSortColumnIndex, getDomainNameToSetSortColumn(query.getName()), query);
performNavigation(pageSize, first);
// Save the query object in session
if(getDomainName().equalsIgnoreCase("DOCUMENTS"))
{
setSearchResults((ArrayList)request.getAttribute("documentResults"));
setSearchResultsColumns(dispCols);
}
System.out.println("search Result "+searchResults.size());
System.out.println("search Columns "+dispCols.size());
// process on filters to be displayed
customizeFilterResults();
}
catch(Exception ex)
{
log.error("-- GetData Method Error "
+ ex.getMessage()
+ " --", ex);
}
datasource= getSearchResults();
System.out.println("first "+first+" pageSize "+pageSize+" sortField "+sortField+" sortOrder "+sortOrder);
System.out.println("searchResultsColumns"+datasource);
System.out.println("searchResultsColumns "+searchResultsColumns);
System.out.println("GET searchResultsColumns "+getSearchResultsColumns());
// rowCount
int dataSize = datasource.size();
this.setRowCount(Integer.parseInt(getResultCount()));
return datasource;
}
}
Look at the console and see if you see any errors. Lazy Loading in early versions of PrimeFaces (2.0) seems to break certain PrimeFaces tooling (like ToolTips).
I was able to fix this by importing JQuery UI after loading the lazy loaded section (i.e inside the <tab> of a lazy loaded <tabView>):
<script src='${request.contextPath}/components/jquery/jquery-ui.js'></script>
I know this ask is repeated, but none response help me to solve this problem.
I'm trying to delete a row from a primefaces datatable with a commandButton and a confirmDialog, this doesn't work because the backBean isn't getting the values. When I'm trying to delete this show me a null pointer exception. well see my code if you can help me.
This is my XHTML:
<h:form id="principalForm">
<p:menubar>
<p:menuitem value="Nuevo" icon="ui-icon-plusthick" oncomplete="PF('wdlgIngresar').show();"/>
</p:menubar>
<p:dataTable id="dtpacientes" value="#{beanPersona.listPersona}" var="per"
paginator="true" rows="15" rowsPerPageTemplate="15,20,30" paginatorPosition="bottom"
paginatorTemplate="{RowsPerPageDropdown} {FirstPageLink} {PreviousPageLink} {CurrentPageReport} {NextPageLink} {LastPageLink}"
selectionMode="single" selection="#{beanPersona.currPersona}" rowKey="#{per.id}">
<p:ajax event="rowSelect" listener="#{beanPersona.onRowSelect}" update=":dlgVer" oncomplete="PF('wdlgVer').show()" />
<p:column headerText="Id" sortBy="#{per.id}" filterBy="#{per.id}">
<h:outputText value="#{per.id}" />
</p:column>
<p:column headerText="Nombre" sortBy="#{per.nombres} #{per.apellidos}" filterBy="#{per.nombres} #{per.apellidos}">
<h:outputText value="#{per.nombres} #{per.apellidos}" />
</p:column>
<p:column headerText="Correo" sortBy="#{per.correo}" filterBy="#{per.correo}">
<h:outputText value="#{per.correo}" />
</p:column>
<p:column headerText="Edad" >
<h:outputText value="#{beanPersona.getEdad(per.nacimiento)}" />
</p:column>
<p:column headerText="Sexo" >
<h:outputText value="#{beanPersona.getSexo(per.sexo)}" />
</p:column>
<p:column id="actions" headerText="Acciones">
<p:commandButton title="Borrar" icon="ui-icon-trash" update=":principalForm:deleteConfirmDialog"
oncomplete="PF('deleteConfirmation').show();" actionListener="#{beanPersona.nullMethod}">
<f:setPropertyActionListener value="#{per}" target="#{beanPersona.currPersona}" />
</p:commandButton>
</p:column>
</p:dataTable>
<!-- HERE beanPersona.currPersona.id HAVE THE CURRENT VALUE CORRECTLY-->
<p:confirmDialog id="deleteConfirmDialog" header="Atencion!" severity="alert" widgetVar="deleteConfirmation"
message="Desea eliminar paciente Nº #{beanPersona.currPersona.id} ?" >
<p:commandButton id="confirm" value="Sí" oncomplete="PF('deleteConfirmation').hide();"
update=":principalForm:dtpacientes" action="#{beanPersona.eliminar(beanPersona.currPersona)}" />
<p:commandButton id="decline" value="No" oncomplete="PF('deleteConfirmation').hide();"/>
</p:confirmDialog>
</h:form>
This is my Bean:
#ManagedBean
#ViewScoped
public class BeanPersona implements Serializable {
private Persona persona = new Persona();
private Persona currPersona = new Persona();
public BeanPersona() {
persona = new Persona();
currPersona = new Persona();
}
public Persona getCurrPersona() {
return currPersona;
}
public void setCurrPersona(Persona currPersona) {
this.currPersona = currPersona;
}
public Persona getPersona() {
return persona;
}
public void setPersona(Persona persona) {
this.persona = persona;
}
public void eliminar(Persona currPersona) {
if(currPersona != null) {
new Dml().delete(currPersona, currPersona.getId());
listar();
System.out.println("succefull delete !!!!");
} else if(this.currPersona != null){
new Dml().delete(this.currPersona, this.currPersona.getId());
this.currPersona = new Persona();
listar();
System.out.println("succefull delete this.currPersona!!!!");
} else {
System.out.println("currPersona is null !!!!");
}
}
public String nullMethod () {return null;}
}
currPersona still null when I throw the method
The attribute onclick is for client side behaviour like executing some JS or showing up a dialog etc. You are not defining an actionListener for your commandButton at all.
Try to remove the onclick completely and use a proper actionListener instead:
<p:column id="actions" headerText="Acciones">
<p:commandButton title="Borrar" icon="ui-icon-trash"
update=":principalForm:deleteConfirmDialog"
oncomplete="PF('deleteConfirmation').show();"
actionListener="#{beanPersona.someActionListener}">
<f:setPropertyActionListener value="#{per}"
target="#{beanPersona.currPersona}" />
</p:commandButton>
</p:column>
I solved it, I just put process tag into "confirm" commandButton with value at "#this"
<p:column id="actions" headerText="Acciones">
<p:commandButton title="Borrar" icon="ui-icon-trash" update=":principalForm:deleteConfirmDialog"
oncomplete="PF('deleteConfirmation').show();" actionListener="#{beanPersona.setCurrPersona(per)}">
<f:setPropertyActionListener value="#{per}" target="#{beanPersona.currPersona}" />
</p:commandButton>
</p:column>
</p:dataTable>
<!-- HERE beanPersona.currPersona.id HAVE THE CURRENT VALUE CORRECTLY-->
<p:confirmDialog id="deleteConfirmDialog" header="Atencion!" severity="alert" widgetVar="deleteConfirmation"
message="Desea eliminar a paciente Nº #{beanPersona.currPersona.id} ?" closeOnEscape="true" >
<p:commandButton id="confirm" value="Sí" oncomplete="PF('deleteConfirmation').hide();"
update=":principalForm:dtpacientes" action="#{beanPersona.eliminar}" process="#this"/>
<p:commandButton id="decline" value="No" oncomplete="PF('deleteConfirmation').hide();"/>
</p:confirmDialog>
I have a JSF page that contains a growl message with primefaces Wizard component. The Wizard contains a FlowListener attribute. On the Flowevent, the growl message should fire however it is not. The FlowListener is working because code not related to updating the growl message is being executed however the growl message is not being displayed. Any help in fixing this is appreciated.
Using: JSF Mojarra 2.2, Primefaces 4.0, Galssfish 4
My JSF code:
<h:form>
<p:growl id="growl" showDetail="true" />
<p:wizard flowListener="#{reviewBean.handleFlow}" >
<p:tab id="Contact" title="Contact Details" >
<p:panel header="#{reviewBean.contactInstr}" >
<p:messages />
<h:panelGrid columns="2" >
<h:outputText value="Address: " />
<p:inputText value="#{reviewBean.contactData.address1}" required="true"
requiredMessage="Address is required" size="50" />
<h:outputText value="Address: " />
<p:inputText value="#{reviewBean.contactData.address2}" size="50" />
<h:outputText value="City: " />
<p:inputText value="#{reviewBean.contactData.city}" required="true"
requiredMessage="City is required" size="50"/>
<h:outputText value="State: " />
<p:selectOneMenu value="#{reviewBean.contactData.state}" >
<f:selectItems value="#{reviewBean.contactData.stateOptions}" />
</p:selectOneMenu>
<h:outputText value="Zip: " />
<p:inputText value="#{reviewBean.contactData.zip}" required="true"
requiredMessage="Zip is required" size="50" />
</h:panelGrid>
</p:panel>
</p:tab>
// Additional tabs omitted .........
</p:wizard>
</h:form>
FlowListener from my Bean:
public String handleFlow(FlowEvent event) {
String currentStepId = event.getOldStep(); // get current tab
String stepToGo = event.getNewStep(); // get next tab in Flow
RequestContext request = RequestContext.getCurrentInstance();
FacesContext context = FacesContext.getCurrentInstance();
switch (currentStepId) {
case "Contact":
// Save user entered contact information to database
datalist.saveContact(contactData, user.getId());
context.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "Data Saved", "") );
request.update("growl");
break;
// remaining cases omitted ........
}
return stepToGo; // return next tab in Flow
}
request.update("growl");
This is the wrong part.
Put an id to your form, then reference it like
i.e
request.update("your_form_id:growl");
Alternatively you could activate the auto-update feature of the growl with the attribute autoUpdate="true" of the growl component, and remove the request.update() method call in your backing bean.
I'm having problems with a form that is rendered by a booleanButtom on PrimeFaces 3.5
the form appear as expected but when I commit the values of the field come null.
The code of the pag:`
<p:panelGrid>
<p:row>
<p:column>
<h:form id="city">
<p:panelGrid columns="2">
<h:outputText value="Name: "/>
<p:inputText label="Name" value="#{managedBean.city.name}"/>
<h:outputText value="Status: "/>
<p:selectBooleanButton value="#{managedBean.city.status}" onLabel="Enable" offLabel="Disable">
<p:ajax listener="#{managedBean.changeStatusCity()}"/>
</p:selectBooleanButton>
<h:outputText value="Add neighborhood?"/>
<p:selectBooleanButton id="btAddNeighborhood" value="#{managedBean.addNeighborCity}" onLabel="Cancel" offLabel="Yes">
<p:ajax update=":addNeighbor" listener="#{managedBean.addNeighborCity()}"/>
</p:selectBooleanButton>
</p:panelGrid>
</h:form>
</p:column>
</p:row>
<p:row>
<p:column>
<h:form id="addNeighbor">
<p:panel header="Neighborhood" rendered="#{managedBean.addNeighborCity}">
<p:panelGrid columns="2">
<h:outputText value="Name: "/>
<p:inputText label="Name" value="#{managedBean.neighborhood.name}"/>
<h:outputText value="Status: "/>
<p:selectBooleanButton value="#{managedBean.neighborhood.status}" onLabel="Enable" offLabel="Disable" onIcon="ui-icon-check" offIcon="ui-icon-close">
<p:ajax listener="#{managedBean.changeStatusNeighbor()}"/>
</p:selectBooleanButton>
</p:panelGrid>
</p:panel>
</h:form>
<h:form id="formBt">
<p:commandButton id="bt" value="Add" actionListener="#{managedBean.saveNeighborCity()}" update=":addNeighbor, :city:btAddNeighborhood"/>
</h:form>
</p:column>
</p:row>
</p:panelGrid>`
And the manage bean
public void addNeighborCity(){
if(addNeighborCity){
neighborhood = new Neighborhood();
neighborhood .setStatus(true);
neighborhood .setStringStatus("Enable");
}else{
neighborhood = null;
}
}
public void changeStatusNeighbor() {
if (neighborhood .isStatus()) {
neighborhood .setStringStatus("Enable");
} else {
neighborhood .setStringStatus("Disable");
}
}
public void saveNeighborCity(){
city.getNeighborhoods().add(neighborhood );
neighborhood = null;
addNeighborCity = false;
}
All the input inside of the form that was rendered doesn't send the information to the manage bean and when I put the button that add the neighbor to the list of the city the button stop working and doesn't call the manage bean any more.
Does someone knows what I'm doing wrong or what is happening.
I'm using Primefaces3.5, GlassFish4.0 and JSF2.2
As you did not post the whole managed bean, I guess that you're using the default scope of the managed bean: #RequestScoped. In that case you should use #ViewScoped.
I solved the problem, I was using glassfish 4 and it forces the jsf2.2 even when you put the jsf2.1 in our project, then I changed to glassfish 3 and all work just fine, thanks for the answers, and I'm using #ScopeSession.
What I try to achieve
I've got a rich:tabPanel with switchType="client" and one of the tabs has set its switchType to ajax because loading its data is an expensive operation. When I click on this Ajax Tab I want its title to be changed to Loading... to indicate that the click has been recognized. When it has finished loading, the title should switch back to Ajax Tab.
[Client Tab] [Ajax Tab]
<click on 'Ajax Tab'>
[Client Tab] [Loading...]
<wait...>
[Client Tab] [Ajax Tab]
<click on 'Client Tab'>
[Client Tab] [Ajax Tab]
Problem description
Actually, most of the described above works as expected, the only problem I have is, that when I navigate from the Ajax Tab to any other tab, the title of the Ajax Tab switches back to Loading...:
[Client Tab] [Ajax Tab]
<click on 'Ajax Tab'>
[Client Tab] [Loading...]
<wait...>
[Client Tab] [Ajax Tab]
<click on 'Client Tab'>
[Client Tab] [Loading...]
Research
I've found an issue in RichFaces' JIRA but this issue is fixed since version 3.2.1. Furthermore I've googled for a few hours but wasn't able to find any similar problems.
Environment
Tomcat 7.0.30
Mojarra 2.1.12
RichFaces 4.2.2.Final
Code (reduced)
JSF
<ui:composition template="WEB-INF/templates/default.xhtml">
<ui:define name="content">
<h:form id="form">
<rich:tabPanel id="tabPanel" switchType="client">
<rich:tab id="clientTab">
<f:facet name="header">
<h:outputText value="Client Tab" />
</f:facet>
<h:outputText value="Foo" />
</rich:tab>
<rich:tab id="ajaxTab" switchType="ajax" status="ajaxTabStatus">
<f:facet name="header">
<a4j:status id="ajaxTabStatus">
<f:facet name="start">
<h:outputText value="Loading..." />
</f:facet>
<f:facet name="stop">
<h:outputText value="Ajax Tab" />
</f:facet>
</a4j:status>
</f:facet>
<h:outputText value="#{bean.value}" />
</rich:tab>
</rich:tabPanel>
</h:form>
</ui:define>
</ui:composition>
Backing Bean of Ajax Tab
#ManagedBean
#ViewScoped
public class Bean implements Serializable {
private static final long serialVersionUID = -8405248908693334970L;
private String value = "noValue";
private static final Logger log = LoggerFactory.getLogger(Bean.class);
#PostConstruct
public void init() {
log.info("Init bean.");
value = getDummyValueWithFakeDelay();
}
public String getValue() {
log.info("Get value.");
return value;
}
private String getDummyValueWithFakeDelay() {
try {
Thread.sleep(1000);
} catch (InterruptedException ex) {
}
return DateFormat.getTimeInstance().format(new Date());
}
}
Update 1:
I've found out that the identifier (i mean that one you specify like <rich:someTag ... status="someStatus" />) of an a4j:status is not its id but its name attribute. So my a4j:status is just for every Ajax request on that page. Giving it a name and using this named status does not work though, because nothing at all happens now.
<rich:tab id="ajaxTab" switchType="ajax" status="ajaxTabStatus">
<f:facet name="header">
<a4j:status id="ajaxTabStatus" name="ajaxTabStatus">
<f:facet name="start">
<h:outputText value="Loading..." />
</f:facet>
<f:facet name="stop">
<h:outputText value="Ajax Tab" />
</f:facet>
</a4j:status>
</f:facet>
<h:outputText value="#{bean.value}" />
</rich:tab>
Update 2:
I've also found another approach, using onbegin and oncomplete attributes with some code like:
<rich:tab id="ajaxTab" switchType="ajax"
onbegin="#{rich:component('ajaxTab')}.?"
oncomplete="#{rich:component('ajaxTab')}.?">
Well, as you see, I haven't found a way to manipulate the tab title yet (and I didn't find any useful documentation of what I can do with a rich:component).
I am not very much familiar with RichFaces 4.x. However this is how to do it in RichFaces 3.
Assume this as you tabPanel.
<h:form>
<rich:tabPanel>
<rich:tab label="Client Tab" switchType="client">
Tab - client
</rich:tab>
<rich:tab label="Ajax Tab" id="ajaxTab" switchType="ajax" ontabenter="changeLabel(event)">
<h:outputText value="#{bean.value}" />
</rich:tab>
</rich:tabPanel>
</h:form>
Note the ontabenter event in the ajax tab.
Now your scripts would be like this.
<script>
function changeLabel(tabId) {
var tabLabel = event.target || event.srcElement;
tabLabel.innerHTML = 'Loading...';
}
</script>
I don't know much about RF4. However in RF3 it is not needed to add an oncomplete event to the tab.
I do the code below with richfaces 4.3.7. It seem to work.
(I display loading panel instead of modify tab header.)
<a4j:status oncomplete="#{rich:component('busy')}.hide()"
onerror="#{rich:component('busy')}.hide()"
onbegin="#{rich:component('busy')}.show()">
<rich:popupPanel id="busy" modal="true" moveable="false"
resizeable="false" autosized="true">
<h:panelGrid styleClass="alignCenter" width="100%" id="busyPanel"
columns="1" border="0" cellpadding="0" cellspacing="2">
<h:outputLabel value="Loading..." />
</h:panelGrid>
</rich:popupPanel>
</a4j:status>
<h:form>
<rich:tabPanel switchType="ajax"
oncomplete="#{rich:component('busy')}.hide()"
onerror="#{rich:component('busy')}.hide()"
onbegin="#{rich:component('busy')}.show()"
>
<rich:tab label="Client Tab" switchType="client">
Tab - client
</rich:tab>
<rich:tab label="Ajax Tab" id="ajaxTab" >
<h:outputText value="#{bean.value}" />
</rich:tab>
</rich:tabPanel>
</h:form>