Questions tagged [view-scope]

The View Scope means that you can keep the object alive as long as you are staying on the view (page).

The @ViewScoped has been introduced by JSF 2.0 specification. In a nutshell the data which is @ViewScoped will keep living as long as you don't navigate to another page to itself. The view scope is very convenient, since it allows the pattern of initializing data when you first access a page (via a non-faces request, which is typically a GET request) and then keep that data when you work on the page, doing post-backs, AJAX requests, etc.

258 questions
0
votes
1 answer

Primefaces datatable and ViewScoped

I'm using primefaces 5.0 on wildfly 8.2.0 (mojarra 2.2.8). I tried to use a simple primefaces datatable with expansion but each time I expand a row, my backed bean @PostConstruct is triggered (which reloads the data which nullifies the use of…
Xavier Dury
  • 1,530
  • 1
  • 16
  • 23
0
votes
0 answers

ViewScoped managed bean recreated on every request

I've managed to get a plain ViewScoped page going. I don't know if I don't understand something or this page isn't working as it should. Every request it creates a new Test object even though it is ViewScoped and I can never get back the theString…
Varis
  • 254
  • 2
  • 11
0
votes
1 answer

Angular + Typescript: What ends up on the $scope?

I'm currently trying to integrate trNgGrid into my angular app where it's unfortunately not possible to bind a function from the controller to an ng-click on a row since it builds the table body itself. Instead, the documentation tells me that I…
xvdiff
  • 2,179
  • 2
  • 24
  • 47
0
votes
1 answer

p:fileUpload inside p:dialog losing @ViewScoped values

I'm trying to update multiple files with . After I upload the files, I set a List with the paths that works fine. After that the user then has to fill some other optional information and then click on a button(to submit the form). When…
prabello
  • 556
  • 2
  • 14
  • 31
0
votes
1 answer

Can't get viewScoped bean from a SessionScoped bean

i would need to get a viewScoped managed bean from a sessionScoped managed bean. I tried firstly using the @ManagedProperty annotation, but i discovered immediately the it does not work and i know why. Secondly i tried to use the following…
MarcoSuma
  • 59
  • 10
0
votes
1 answer

Delete data using ViewScoped

i'm using ViewScoped in my controller but i need to do something wired.. i want to mantain the data when using that view but if i leave that view, and then return i dont want the data there! @Component("sponsorController") @ViewScoped public class…
tiagocarvalho92
  • 375
  • 1
  • 7
  • 17
0
votes
1 answer

Is this possible @viewScope from JSF cause memory leak?

My webapplication is occuring a memoryleak.(I monitored the webapp with visualVM) Each time, I go on a specific jsf page which bean is annotated with ViewScope, the heap increase. With viewScope, all the objects (and memory) should be cleared when i…
ZheFrench
  • 1,164
  • 3
  • 22
  • 46
0
votes
1 answer

viewscoped bean is called on every access of back bean

I'm trying to create a bean using the view scope but the @PostConstruct function is called on every access of the bean. Here is a very simple example (.xhtml):
0
votes
1 answer

ViewScoped CDI bean recreated after some AJAX requests

I have a CDI ViewScoped bean and a JSF page. After a couple of AJAX requests the bean somehow recreated. Here is the full code of the application: index.xhtml
Salih Erikci
  • 5,076
  • 12
  • 39
  • 69
0
votes
1 answer

@ConversationScoped is spoiling the filtering and sorting options in form, @ViewScoped works fine

I'm working on a small course passing project, and I have a problem. The manager.xhtml is a JSF page, it is used to view the data from database, sort them, filter them, delete entries and edit those entries. When I'm using @ViewScoped in…
hc0re
  • 1,806
  • 2
  • 26
  • 61
0
votes
2 answers

Primefaces ViewScoped

I want my managed bean to be cleared after a successful action. I use PrimeFaces5.0 for web page. Here is a block. I used partialSubmit and process to submit only one part of the form. ...
hasan
  • 3
  • 1
0
votes
1 answer

jsf custom converter does not work with view scope

Here is my code Pojo public class Deal implements Serializable { private int id; private String name; private String description; private Customer customer; //getter setter omitted } public class Customer implements Serializable { private int…
0
votes
1 answer

JSF Flash arguments not carried over to next view (and no ?faces-redirect=true in browser URL)

We have a page that contains a command link: This is supposed to redirect to the Result Manager view, secretly passing a…
Kawu
  • 13,647
  • 34
  • 123
  • 195
0
votes
1 answer

JPA entities in JSF @ViewScoped backing bean always getting detached?

I'm currently trying to learn JSF and JPA. I know that the patterns I use are not recommended at all, but I want to understand what's going on because I think it'll help me in the future. I've just thrown together a prototype from various…
Hein Blöd
  • 1,553
  • 1
  • 18
  • 25
0
votes
1 answer

Will Spring 4.1 support JSF 2.2?

Some time ago I heard a rumor saying Spring 4.1 is going to support JSF 2.2. In particular, SpringBeanFacesELResolver would be able to create view scoped controller beans. Spring 3 only supports application scope, request scope and session scope. As…
Stephan Rauh
  • 3,069
  • 2
  • 18
  • 37