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

Trying to understand @ViewScoped on JSF with tomEE and PrimeFaces

My question is how can i access to a @ViewScoped from another @ViewScoped Bean, i have a ViewScoped which is the controller and in the controller bean i need to get the instance of another bean, a ViewScoped bean which is a Model Bean. Im trying…
Luis Miguel
  • 495
  • 8
  • 22
0
votes
0 answers

viewscope bean gets instantiated on every request

There are other questions about this but none of them solved my problem. viewscope bean is instantiated(its constructor is called) whenever I refresh same page in browser. here is xhtml:
lazyCoding
  • 481
  • 2
  • 5
  • 13
0
votes
1 answer

Update @ViewScoped bean from JAX-RS service

I've got a mishmash of JAX-RS webservices and JSF/CDI beans. Usual display of my @Entitys is from a @ViewScoped JSF bean collecting relevant entities in a @PostConstruct method: @Named @ViewScoped public class Manager { private List
mabi
  • 5,279
  • 2
  • 43
  • 78
0
votes
1 answer

JSTL c:forEach causes CDI (Seam 3) @ViewScoped bean to invoke @PostConstruct on every AJAX request using Mojarra 2.1.18+

This is a followup question to some questions on stackoverflow.com: JSTL c:forEach causes @ViewScoped bean to invoke @PostConstruct on every request Why does @PostConstruct callback fire every time even though bean is @ViewScoped? JSF However, we're…
Kawu
  • 13,647
  • 34
  • 123
  • 195
0
votes
0 answers

Can I use ViewScoped without Serializing beans in JSF 2.1.10

We are using JSF 2.1.10 & mojarra and I don't see we will upgrade to 2.2 or 2.1.18 any time soon because of some other dependencies. Now, I want to use ViewScope for my managedBean as i have some ajax functionality. If i use requestScope, it keep on…
nani21984
  • 911
  • 2
  • 13
  • 21
0
votes
1 answer

Pass dataTable value of the row to new JSF using managed bean or?

How do I pass the value in my dataTable to another jsf page? I managed to pass the value by using f:param but I have no clue how to get the data in dataTable and pass the value.
Mr Kids
  • 11
  • 5
0
votes
1 answer

How to survive viewscoped beans/viewmap after session destroy (using client side saving)?

I'm using Myfaces 2.2 with Client-side state saving. I see that the ViewScoped beans & data stored in viewmap is lost after the user session is destroyed. I came to know, not sure if it is correct, that this is the expected behavior but then what's…
Rajat Gupta
  • 25,853
  • 63
  • 179
  • 294
0
votes
1 answer

Non-ajax method giving same result in ViewScoped managed bean

I have a dataTable like following
Kush Sahu
  • 399
  • 1
  • 13
  • 33
0
votes
1 answer

Is it possible to restrict view scoped bean creation only to an active tab in a tab view

My application structure goes like this template.xhtml
Srikanth Ganji
  • 1,127
  • 1
  • 13
  • 29
0
votes
1 answer

Setting view scope on JSF 2.2

On JSF 2.2 we don't have the option to set the View Scope on faces-config.xml . So how should it be done? Is the view scope missing on JSF 2.2 ? Thank you!
Luciane
  • 259
  • 4
  • 23
0
votes
2 answers

Update a view scoped JSF beans' injected bean

@SessionScoped public class User { ... //settings, attributes, etc } @ViewScoped public class FooController { @ManagedProperty(value="#{user}") private User user; ... } @RequestScoped public class LoginController…
Eric
  • 1,953
  • 4
  • 24
  • 33
0
votes
0 answers

Access @ViewScoped bean from custom component

I have a custom JSF component that has an attribute that references a method within a backing bean by EL expression. The referenced method should be called as part of the component's decode process. This works quite well for a @SessionScoped bean,…
Florian
  • 1,142
  • 1
  • 9
  • 21
0
votes
1 answer

Action Button works differently if added to the DataView

I have a button that calls a Dialog that has a combo box bound to a sessionScope variable. The combo box contains a list of form names that I use to then call an XPage to create a new document. The first value in the forms list is "" so the user…
Bill F
  • 2,057
  • 3
  • 18
  • 39
0
votes
1 answer

Why a View is reinstancied, when we click a commandButton displayed in richfaces component displayed after an ajax call?

Initially my question was : Does richfaces 4.3.4 support JSF 2.2 and ViewScoped? But now the question is in the title.Thanks :) I'm trying to solve this problem. Why a View is reinstancied, when you click a command button displayed in richfaces…
ZheFrench
  • 1,164
  • 3
  • 22
  • 46
0
votes
1 answer

Why PostConstruct method is called several times inside an RichFaces 4.3 component with a ViewScoped?

I 'm facing a problem with JSF 2.2, richfaces 4.3.2 on Tomcat 7 . My page is annoted ViewScoped. I display a first form. When i change the value and select a specific one , i display by ajax a rich:panel element inside an a4j:outputPanel. Inside…
ZheFrench
  • 1,164
  • 3
  • 22
  • 46