view-scope

p:fileUpload calls bean constructor for each file

不打扰是莪最后的温柔 提交于 2019-12-24 07:13:35
问题 I'm trying to use <p:fileUpload> to upload a file. Here's the view: <h:form enctype="multipart/form-data"> <p:growl id="messages" showDetail="true" /> <p:fileUpload fileUploadListener="#{viewscopedBean.handleFileUpload}" mode="advanced" dragDropSupport="true" multiple="true" update="messages" /> </h:form> Bean: @ManagedBean @ViewScoped public class ViewscopedBean implements Serializable{ private List<UploadedFile> uploadedFiles; //to remember which files have been uploaded public

@org.omnifaces.cdi.ViewScoped invokes @PostConstruct on unload of an already destroyed view

可紊 提交于 2019-12-23 02:52:54
问题 I have a problem working with @org.omnifaces.cdi.ViewScoped and multiple tabs: I have a link in TestPage.xhtml that opens another page (ShowValuePage.xhtml) with a request parameter "someValue". If I open this link 10 times in a new tab and navigate away in the first opened tab, PostConstruct will be called again instead of just navigating away. Same happens if I navigate back from ShowValuePage to TestPage multiple times. (To test this, we must click the links "Show Value" and "Home"

CDI ViewScope & PrettyFaces: Multiple calls to @PostConstruct (JSF 2.2)

冷暖自知 提交于 2019-12-22 10:18:29
问题 I'v already check similar questions which declare that JSF 2.1 had this bug, but I'm using JSF 2.2 Let's detail: My environment: CDI: 1.1 Dynamic Web Module: 3.0 Java: 1.7 JSF: 2.2 PrettyFaces: 2.0.12.Final My Bean: @Named(value = "home") @javax.faces.view.ViewScoped public class HomeBean implements Serializable { @Inject private HomeController controller; private List<Store> myPopularStores; @PostConstruct public void postConstruct() { myPopularStores = controller.getStores(); LOG.log(Level

WELD-001303 No active contexts for scope type javax.faces.view.ViewScoped

独自空忆成欢 提交于 2019-12-21 06:29:55
问题 I have switched to javax.enterprise.context.SessionScoped to javax.faces.view.ViewScoped Upgraded faces 2.1 to 2.2 to be able to use ViewScoped with my CDI injections. After I switched to ViewScoped I have started getting this error and I can't figure out why! Do you think there is something wrong here? Glassfish 3.1.2, Primefaces 3.4.2, JSF 2.2 org.jboss.weld.context.ContextNotActiveException: WELD-001303 No active contexts for scope type javax.faces.view.ViewScoped The button opens the page

Are JSF 2.x @ViewScoped managed beans thread safe?

折月煮酒 提交于 2019-12-20 10:28:57
问题 I've been googling for a couple hours on this issue to no eval. WELD docs and the CDI spec are pretty clear regarding thread safety of the scopes provided. For example: Application Scope - not safe Session Scope - not safe Request Scope - safe, always bound to a single thread Conversation Scope - safe (due to the WELD proxy serializing access from multiple request threads) I can't find anything on the View Scope defined by JSF 2.x. It is in roughly the same bucket as the Conversation Scope in

Will PrimeFaces Dialog Framework break view scope as compared to p:dialog?

大兔子大兔子 提交于 2019-12-19 02:13:53
问题 I'm using PrimeFaces 5. I would like to open a dialog when a button is pressed. <p:commandButton value="add upload" actionListener="#{theForm.openUpload}" > public void openUpload() { this.item = new Item(); RequestContext.getCurrentInstance().openDialog("uploadForm"); } There will be a save button in the dialog to save the inputs. <h:commandButton value="#{text['button.add']}" id="add" styleClass="btn btn-default" actionListener="#{theForm.confirmAdd}"/> public void confirmAdd() {

Will PrimeFaces Dialog Framework break view scope as compared to p:dialog?

谁说胖子不能爱 提交于 2019-12-19 02:13:52
问题 I'm using PrimeFaces 5. I would like to open a dialog when a button is pressed. <p:commandButton value="add upload" actionListener="#{theForm.openUpload}" > public void openUpload() { this.item = new Item(); RequestContext.getCurrentInstance().openDialog("uploadForm"); } There will be a save button in the dialog to save the inputs. <h:commandButton value="#{text['button.add']}" id="add" styleClass="btn btn-default" actionListener="#{theForm.confirmAdd}"/> public void confirmAdd() {

@ViewScoped Managed bean loads many times during postback

血红的双手。 提交于 2019-12-18 13:26:14
问题 I have a calendar, editor, fileUpload and a dataTable primefaces controls on a jsf facelet. Code is as follows, <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <ui:composition xmlns:ui="http://java.sun.com/jsf/facelets" template="./../templates/masterlayout.xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:p="http://primefaces.prime.com.tr/ui" xmlns:f="http://java.sun.com

JSF View Scoped Bean Reconstructed Multiple Times [duplicate]

巧了我就是萌 提交于 2019-12-17 19:54:45
问题 This question already has an answer here : @ViewScoped calls @PostConstruct on every postback request (1 answer) Closed 3 years ago . I thought @ViewScoped was supposed to prevent the bean from being reconstructed while the user is on the same page... So why is my @ViewScoped JSf controller bean being created multiple times even before the action handler causes the browser to navigate away from that view? Can anyone point me in the right direction here? Here is my code: The View (domain/edit

Why does @PostConstruct callback fire every time even though bean is @ViewScoped? JSF

匆匆过客 提交于 2019-12-17 07:14:25
问题 I am using datatable on page and using binding attribute to bind it to my backing bean. This is my code :- <?xml version='1.0' encoding='UTF-8' ?> <!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:h="http://java.sun.com/jsf/html" xmlns:p="http://primefaces.prime.com.tr/ui"> <h:head> <title>Facelet Title</title> </h:head> <h:body> <h:form prependId="false"> <h:dataTable var=