Primefaces Command button hangs IE 9 browser - jsf-2

I've been working with JSF and primefaces for past 2 years. I'm facing an issue with the Primefaces CommandButton while using <p:commandButton> with <f:setPropertyActionListener> specifically in IE 9 (works fine in IE 8, IE 10 and IE 11).
Below is the code I'm using
<p:commandButton styleClass="btn-primary-starr btn-starr right-align-only" value="#{traveldictionary['travel.tile.traveler.Continuebutton']}" update=":tabContent :createQuotePage" process=":tabContent">
<f:setPropertyActionListener target="#{DeleteTravelerDetailManagedBean.ajaxMap['DeleteNoteMessage']}"
value="false" />
<f:setPropertyActionListener
target="#{headerApplicationManagedBean.ajaxMap['Object::Tab::Active']}"
value="payment">
</f:setPropertyActionListener>
<f:setPropertyActionListener
target="#{headerApplicationManagedBean.ajaxMap['Object::Tab::GetQuotes']}"
value="show">
</f:setPropertyActionListener>
<f:setPropertyActionListener
target="#{headerApplicationManagedBean.ajaxMap['Object::Tab::Save::travelerinformation']}"
value="true">
</f:setPropertyActionListener>
</p:commandButton>
When this command button is clicked the IE 9 browser force closes
But works on all other browsers including IE 8, IE 10 and IE 11. I did some research to find out if there were any known issues with IE 9 and Primefaces but no luck.
It would be really helpful if someone could shed some light on this. Thanks in advance.

Related

Display dialog from backing bean in primefaces mobile

I am doing mobile conversion of our website using PF mobile. In that I am trying to open views in a dialog using Primefaces mobile. It works just fine in desktop browser but not in mobile version. The page keeps waiting to load but nothing happens. Is it not implemented in PF mobile or is something wrong with my code?
Following is the view - webapp/m/dlg/sampledlg.xhtml
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"xmlns:h="http://java.sun.com/jsf/html"xmlns:f="http://java.sun.com/jsf/core"xmlns:p="http://primefaces.org/ui"xmlns:pm="http://primefaces.org/mobile"><f:view renderKitId="PRIMEFACES_MOBILE" /><h:head></h:head><h:body><pm:page id="main"><pm:header title="Main Page">/pm:header><pm:content><p:link outcome="pm:second" value="Go" /></pm:content></pm:page><pm:page id="second" lazy="true"><pm:header title="Second Page"></pm:header><pm:content>Sample content</pm:content></pm:page></h:body></html>
Following is the code from the backing bean.
RequestContext.getCurrentInstance().openDialog("dlg/sampledlg");
return;
Also basic dialog like the following that displays only a message doesnt work either in mobile pages. It works in desktop though.
RequestContext.getCurrentInstance().showMessageInDialog("This is sample text");
face-config.xml has the following:
<navigation-handler>
org.primefaces.application.DialogNavigationHandler
</navigation-handler>
<view-handler>org.primefaces.application.DialogViewHandler</view-handler>
<navigation-handler>org.primefaces.mobile.application.MobileNavigationHandler</navigation-handler>
I can absolutely add more information if needed. Any help here is much appreciated. Thank you in advance.
Here is my platform information:
- Tomee 7.0.0 M3
- Primefaces 6.0
- Jsf 2.2.12
- Jdk 1.7
- Jee 7
Working solution:
bean:
...
RequestContext.getCurrentInstance().execute("PF('dlgDelete').show();");
xhtml:
...
<p:dialog header="confirmation" widgetVar="dlgDelete" >
<p:outputLabel value="Are you...?"/>
<p:commandButton value="yes" action="#{appBean.deleteMethod()}" update="tblParts" oncomplete="PF('dlgDelete').hide();" icon="ui-icon-check" iconPos="right" styleClass="ui-btn-inline"/>
<p:commandButton value="no" onclick="PF('dlgDelete').hide();" icon="ui-icon-forbidden" iconPos="right" styleClass="ui-btn-inline"/>
</p:dialog>

prime faces ajax not working

We have a JSF project with the following versions of JARs:
Prime Faces 5.1
JSF 2.0
Javaee-api 5
But the Project Facets(in eclipse) defines JSF 2.2, we never changed it.
JPA 2 ( javaee-api 5)
Ejb 3.0
Our ajax is not working.
<p:selectOneRadio id="enrolledInPlanFlag" value="#{phInfoBean.enrldPlanFlag}" label="Action" >
<f:selectItem itemLabel="Yes" itemValue="Yes" />
<f:selectItem itemLabel="No" itemValue="No" />
<p:ajax process="enrolledInPlanFlag" update="#form"/>
</p:selectOneRadio>
<p:dialog id="dialog" header="APTC Warning" widgetVar="dlg1" modal="true" height="200" width="500" resizable="false" rendered="#{phInfoBean.enrldPlanFlag eq 'Yes'}">
I am trying to display dialog based on the selectOneRadio. But the AJAX is not working and we have the wierd situation where sometimes it works and sometimes it not.
We have annotated managed bean with #ViewScoped.
Please help.
Make it work
You never show your dialog in your code. You could attach an oncomplete event to your p:ajax
<p:ajax process="enrolledInPlanFlag" update="#form" oncomplete="PF('dlg1') != null ? PF('dlg1').show() : ''" />
The condition PF('dlg1') != null is required as if you choose "No" your dialog is no longer rendered in your page, therefore PF('widgetVarOfDialog') is unreachable.
Additional notes
I would improve this code by:
Changing enrldPlanFlag to a boolean instead of a string (cleaner IMO)
Display the dialog programatically in an listener (called from your p:ajax) if the boolean is true
Why? To leave the logic in your bean instead of your .xhtml page

How <a4j:commandButton> works on RichFaces 4

People,
I have an application with RichFaces 3 that works perfectly and i'm trying change to RichFaces 4.
The problem that could not solve involves the use of the .
On RichFaces 3, the below code works:
<a4j:commandButton value="button test" action="#{bean.executeAction()}" reRender="myForm"/>
I try change to
<a4j:commanButton value="button teste" action="#{bean.executeAction()}" render="myForm"/>
or
<a4j:commanButton value="button teste" actionListener="#{bean.executeAction()}" render="myForm"/>
or n others possibilities, however, nothing work.
Help please.
You could try to add the 'execute'.
<a4j:commandButton value="Button" type="submit"
id="button_1" render="myForm"
execute="#form"
action="#{bean.executeAction()}" />
This button works for me at least

Video (p:media) does not start

I can't get p:media to work, tested with Chrome and IE, different Quicktime- and Windows-types over StreamedContent (see example below) and by referencing it from the resources-folder (value=/resources/clear.avi) of my webapp. No video starts to play although loading & rendering seems to be "working" per se. The player shows up and the loaded video seems not to be broken while the files aren't for sure (playing works on desktop usage). When using StreamedContent, I start to render after loading the video.
My config:
PrimeFaces 3.5
Apache MyFaces 2.1.12
Jetty 9.0.4
What can be wrong here?
<h:panelGroup id="video">
<p:media value="#{contentEditorBean.media}" width="250" height="190" player="windows" rendered="#{contentEditorBean.media != null}">
<f:param name="autoPlay" value="false" />
</p:media>
</h:panelGroup>

Primefaces 3.0.M4 IE 7. CheckAll checkbox not working

I am using Primefaces 3.0.M4, 12/1/2011 build with JSF 2.0, web application. CheckAll checkbox in table header to toggle multiple selection checkboxes does not work in any browsers i tested in. I tried it in IE7, Firefox 5.0 in windows. Firefox 7 in ubuntu. No luck.
<p:dataTable id="blocksTable"
var="block" value="#{splitBlockBean.blockDataModel}"
selection="#{splitBlockBean.selectedBlocks}"
scrollable="true" scrollHeight="230" scrollWidth="410">
<p:column selectionMode="multiple"/>
<p:column style="width:300px;" headerText="Subnet Address">
#{block.label}
</p:column>
</p:dataTable>
Now, If I remove scrollbars around this table, it works fine. But not with scrollbars. I need scrollbars as this table can display records upto 256 and users wants to able to select all at one go without having to use paginator.
Interesting aspect I found in datatable.js is that JQuery does not return checkAllToggler checkbox if the table is surrounded by a scrollbar. Here's is the snippet from datatable.js
this.checkAllToggler = $(this.jqId + ' > table thead th.ui-selection-column input:checkbox');
this.checkAllToggler.bind('click', function() {
_self.toggleCheckAll();
});
Any help is apprecaited.
You need to use a recent 3.0.RC1 build, more info http://code.google.com/p/primefaces/issues/detail?id=1552

Resources