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
0 answers

@PostConstruct called multiple times with custom view scope

I have a project using JSF 2.0 , mojarra 2.2.4, Tomcat 7 and Primefaces 3.5. We also use Spring and Hibernate. I am facing a problem regarding the @PostContruct anotated method. It should be called only once, when the Page is created, but instead it…
Anika
  • 398
  • 5
  • 23
0
votes
1 answer

Primefaces datatable row selection does not work in viewscope

In my application I am using ViewScoped Bean and it does not show selected row when a row is selected in primefaces datatable. But if I changed the Bean to a SessionScoped Bean then it shows the selected row perfectly. my code is like below. …
gsk
  • 95
  • 4
  • 9
0
votes
0 answers

Primefaces datatable select row not working in viewscope

In my application I am using ViewScoped Bean and it does not show selected row when a row is selected in primefaces datatable. But if I changed the Bean to a SessionScoped Bean then it shows the selected row perfectly. I read some forum posts and I…
gsk
  • 95
  • 4
  • 9
0
votes
0 answers

viewscoped bean action can't return same view

I'm having troubles with view scoped bean. I have commandbutton in xhtml, with associated action in managed bean which is supposed to render the same view again. Action method returns fine, but no view is rendered, it's stuck with "waiting for…
qwerty
  • 175
  • 4
  • 15
0
votes
1 answer

RichFaces 4 : Datatable Style Effect as in RF showcase not working in a Scope View

I'm trying to do styling on my jsf datatable as show here : It's working the first time the page load. But when i make a sort on a column with an ajax call (as explained on the link shown before) , the styling disappears. If I refresh, the styling…
ZheFrench
  • 1,164
  • 3
  • 22
  • 46
0
votes
1 answer

Setter of application scoped bean fails to set value

I'm making page using Primefaces with form with ability to ajax-upload image and preview it before submitting whole form. To achieve this I made dialog outside main form:
Tloo
  • 21
  • 5
0
votes
0 answers

jsf viewscoped bean - set values for every page(tabs)

I am sorry, this might sound really basic but if anyone could explain how to set explicit values for every tabs in the same browser window using the JSF viewscoped bean. Please guide me to some article or working samples. Kindly help, thanks in…
Dinesh Kumar
  • 2,838
  • 1
  • 16
  • 18
0
votes
1 answer

@Named @ViewScoped gives java.io.NotSerializableException

I found a lot of articles to @ViewScoped and java.io.NotSerializableException but nothing helped in my case. Perhaps because I am using CDI @ViewScoped and most older questions are about @ManagedBean. Reproduction: I have a presentation model with…
timmornYE
  • 708
  • 2
  • 8
  • 22
0
votes
1 answer

How to dynamically populate pick list right side values

I am using rich:popuppanel component and having issues with populating values in picklist. My requirement is as below. Populate extended data table Select a row using check box - User ID in that row will be passed to backing bean Click assign…
user2455158
  • 97
  • 3
  • 12
0
votes
1 answer

ViewScoped for CDI in JSF2.2 lifeCycle

I am trying to use @ViewScoped in javax.faces.view.ViewScoped with the @Named annotation, but for some reason every time I invoke my action to update part of my page, my bean instantiate again and I don't get the expected result! which if I use…
meysamabl
  • 11
  • 1
0
votes
1 answer

jsf 2 passing of value to dialog not working

I want to pass a value to a dialog but it wont work. I have tried this approach but no luck Here is my page:
borj
  • 99
  • 2
  • 4
  • 13
0
votes
1 answer

how to destroy managed bean with viewscoped in jsf

I am developing a JSF 2.1 project. I am using primefaces 3.5 components. There are two managedbean with viewscoped, WizardBean and CreateInputBean. They are used in wizard component(primefaces). The last point first wizard, I click a button then…
Burak Dağlı
  • 512
  • 2
  • 10
  • 33
0
votes
0 answers

jsf 2.0 viewscope in two windows need to refresh each other

I have a problem: I have a View-Scoped bean/view with an overview of some data (list). when someone clicks on an item, it opens another view-scoped window/browser tab which loads and shows some detailed information about the item clicked. All I…
Niko
  • 1,054
  • 5
  • 25
  • 52
0
votes
0 answers

ViewState updated/changed when part of page rendered

My code looks like this:
Jonny boy
  • 1
  • 2
0
votes
1 answer

Primefaces Datatable recreate viewScoped bean

I have a data table with 5 columns. The first column contains: