RequestContext.getCurrentInstance() gives null

UI Components for JSF
Post Reply
rubi
Posts: 160
Joined: 24 May 2010, 16:53

13 May 2011, 18:16

RequestContext.getCurrentInstance() gives null . Any Idea?
Glassfish V3.1.1,Mojarra 2.1.2, PrimeFaces-3.0RC1

giberius
Posts: 42
Joined: 08 Jan 2011, 14:20

13 May 2011, 22:53

I think that only if it started from an Ajax call you will get a value.

The function in the bean was started from a listener? So, perhaps use an attribute ajax="true".

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

13 May 2011, 23:07

RequestContext is available to ajax requests only.

rubi
Posts: 160
Joined: 24 May 2010, 16:53

14 May 2011, 17:38

yes its an ajax request. I wrote the statement inside the action method of p:commandButton
I am using weld by the way... does that have any issues?
Glassfish V3.1.1,Mojarra 2.1.2, PrimeFaces-3.0RC1

Clemiou
Posts: 10
Joined: 06 Apr 2011, 10:37

16 Jul 2011, 10:11

Hi,

I can observe the same behavior on my components.
But this is not all the times.
Sometimes it works.

When I track the issue with Firebug, I can see that in the wrong cases, the Ajax request is duplicated.
I haven't any solution yet.

Clemiou

Michmich974
Posts: 2
Joined: 06 Dec 2012, 17:23

06 Dec 2012, 17:35

Hello,

I dig out this topic because I observed the same behavior but only with IE8.
Sometimes it work, and sometimes not.

And as the previous comment, I can observe that Ajax request is sent twice.
The first sent in fact works correctly, but the second have the RequestContext null.
Is there a fix for this problem?

Regards,
Michmich974
Regards,
Michmich974
PF v3.2, PF ext v0.5.1, Tomcat 6.0.35

User avatar
andyba
Expert Member
Posts: 2473
Joined: 31 Mar 2011, 16:27
Location: Steinfeld, near Bremen/Osnabrück, DE
Contact:

06 Dec 2012, 17:43

Michmich974 wrote:Hello,

I dig out this topic because I observed the same behavior but only with IE8.
Sometimes it work, and sometimes not.

And as the previous comment, I can observe that Ajax request is sent twice.
The first sent in fact works correctly, but the second have the RequestContext null.
Is there a fix for this problem?

Regards,
Michmich974
At the bottom of this reply you will see 2 links. Follow the first one, read the Rules you find there and learn them.
Take any and all appropriate actions regarding your signature.

Your question also has no Request Context but not because it is not an AJAX request but because you broke the rules and provided no information which could possibly lead to a solution. Post any question you have in its own thread and don't forget to do what the rules tell you to.
PF 4.x (Elite versions), PF 5, Pf 5.1, PF 6.0
Glassfish 4.1, Mojarra 2.x, Java 8, Payara 4.1.1.
If you haven't read the forum rules read them now

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 26 guests