jsf-2

JSF 2.0 ViewExpiredException on Glassfish 3.1 when using iframe in Safari

谁说我不能喝 提交于 2019-12-19 10:43:07
问题 I have a JSF 2.0 web application running on glassfish 3.1 that is working fine on IE, FF, Safari and Chrome. When I added the url of my website inside a iframe of another website then I am getting ViewExpiredException after clicking any button inside iframe - This happens only on Safari, works fine in IE, FF, Chrome. <iframe style="width: 100%; height: 800px" src="url_of_my_website" frameBorder="0"></iframe> Following are my observations Deployed the same application on glassfish 3.0.1 and

What is the difference between Custom Components and Composite Components?

牧云@^-^@ 提交于 2019-12-19 10:35:10
问题 What is the difference between JSF Custom Components and Facelets Composite Components? 回答1: JSF custom components are Java classes which extend UIComponent. Facelets composite components are XHTML files which use http://java.sun.com/jsf/composite namespace. See also: When to use <ui:include>, tag files, composite components and/or custom components? 来源: https://stackoverflow.com/questions/5704620/what-is-the-difference-between-custom-components-and-composite-components

<h:commandButton> does not initiate a postback

百般思念 提交于 2019-12-19 10:27:39
问题 I am using JSF 2.1.7 and Myfaces CODI 1.0.5 on JBoss AS 7.1.1. My <h:commandButton> is not working. I have read the requirements and have through examples in many blogs all to no avail. My facelets code is as follows <ui:define name="pagecontent"> <h1 class="title ui-widget-header ui-corner-all">Upload Bulk Contact File</h1> <div class="entry"> <h:form enctype="multipart/form-data" id="upload"> <p:panel closable="false" collapsed="false" header="Excel Contact Uploader" id="pnlupload" rendered

Call multiple bean method in primefaces simultaneously

和自甴很熟 提交于 2019-12-19 10:22:19
问题 I am building a web application using primefaces-4.0. I wanted to call two bean methods simultaneously on click of command button. I tried it by using remoteCommand . <p:commandButton value="Submit" ajax="false" actionListener="#{userBean.execute}" onclick="callCorrelation()"> </p:commandButton> <p:remoteCommand name="correlation" update="correlationDialog" actionListener="#{userBean.correlation}" /> Java Script function : <head> <script type="text/javascript"> $(document).callCorrelation

How use SocialAuth with JSF to redirect?

痞子三分冷 提交于 2019-12-19 10:18:24
问题 I'm trying to use SocialAuth, the idea is very simple, click in log in with facebook then redirect the user to my website signed in. The log in part I get it, which is below : 1) /index.xhtml <h:form id="login-facebook"> <h:commandButton id="login" action="#{socialFacebook.login}" value="Login"/> </h:form> 2) socialFacebook bean package controller; @ManagedBean(name="socialFacebook") @RequestScoped public class SocialFacebook implements Serializable{ private static final long serialVersionUID

javax.el.PropertyNotFoundException with CompositeComponent?

▼魔方 西西 提交于 2019-12-19 10:17:38
问题 I'm currently trying to build a composite component, and this is how i make use of my component : Include it with xmlns:albert="http://java.sun.com/jsf/composite/albert" And here's the usage example <albert:infoButton infoId="infoSingleRecord" params="transDateFrom transDateTo" mappingMethod="#{tBrowseBean_ConfirmedRPB.mapSendInfoSingleRecord}" /> And this is the component which is put in resources/albert/infoButton.xhtml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C/

Why is my ViewScoped bean not surviving h:commandButton?

旧街凉风 提交于 2019-12-19 10:09:18
问题 Deploying on JBoss AS 7.1.0.Final. I have a very simple test app. It was working as expected until the other day (famous last words) and is no longer doing the most basic thing, namely setting the value of the input component and using it in the action component. I have stripped this thing down to the basics and can not figure out what is going on. index.xhtml is here <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

How to set the locale programmatically in JSF

假装没事ソ 提交于 2019-12-19 10:06:24
问题 I'm currently trying to set the locale programatically, but can't find a good solution. The use case is I have another website that post data to my site that has a locale parameter, and base on this locale, I have to render my page. I've already tried setting the locale on preRenderView, constructor and PostConstruct but it seems it's already to late. Any suggestion? Thanks. 回答1: Key point is that you need to set the locale by UIViewRoot#setLocale() before the view is ever rendered. The <f

How can I make use of customized icons in PrimeFaces?

不问归期 提交于 2019-12-19 09:56:16
问题 PrimeFaces provides a lot of icons from jQuery themeroller. They're useful but I need to have some customized icons for my app. Suppose I have a <p:commandButton> : <p:commandButton icon="ui-icon ui-icon-check" /> Since my CSS knowledge is very limited, I'd be very grateful if you could show me how I can put some customized icon into the label of the above button. Best regards, 回答1: You need to define your own css class: .img-button-help { background-image: url('../images/help.png')

Primefaces File upload, Drop file outside of p:fileUpload anywhere in the page

为君一笑 提交于 2019-12-19 09:47:45
问题 In primefaces file upload, FileUpload component itself is the drop zone. I want to create multiple dropzones, for example if user drops files on any other div or table the Primefaces File upload component should pick that. I tried to trigger drop event manually for primefaces upload component but this is not working. Please help me with this. Thanks in advance! Here is what I tried, $('.otherdropzone').on( 'dragover', function(e) { e.preventDefault(); } ); $('.otherdropzone').on( 'dragenter',