• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JSF 1.2 Postback

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I've tried to solve this problem many ways, I just can't seem to find a good way around this. Thanks for any advice.

I'm using Richfaces, although, this problem also occurs in other frameworks, so I'm assuming its JSF 1.2 specific.
What I'd like to do and what I have is one page say test.jsp, that is the app with Richfaces components. In this
app I have a very large data pagination table that is in a verbatim section draw by calling a Java method. The
table does not use any components. What happens is, the a4j slows down tons, due to trying to render this full
table on all ajax calls, I'm not sure why JSF or the framework calls the method to redraw this part of the page
and holds it in the tree to send through ajax, but I understand using a postback check should prevent this.

So I've tried to use the post back check in 1.2:
public static boolean isPostBack() {
ResponseStateManager rsm = FacesContext.getCurrentInstance().getRenderKit().getResponseStateManager();
return rsm.isPostback(FacesContext.getCurrentInstance());
}

Inside the method that is getting called, however, FF consistently doesn't draw since this is a postback call when doing
a javascript resubmit onclicking a link in the app that is non-ajax based, although IE will seemingly randomly draw the
table. I'm not sure if this postback check is an issue with JSF or the browsers.

I'm also not sure how to get around this problem, I tried adding in code to fix this, which gets around the problem in FF but
not in IE. Just curious on how to render this table without ajax slowing down keeping the table in the tree for the view.

Thanks, I hope I explained this well, its hard to describe the issue, feel free to ask more questions on my issue etc. I'd
really like to understand the issues here and how to get around this.
 
jmiller jmiller
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This was solved, turns out there was a couple issues here.

One was the Postback, another was a redraw issue with when to draw
parts of the JSF page due to mixing ajax and non-ajax requests. And
a race condition thats probably more tool specific using the richfaces
components.

The issue with richfaces was that I was doing a javascript page submit,
and richfaces was trying to do a ajax request after the submit, but my
best guess is that a submit event was being fired by javascript and allowing
another function call to take place attempting to do an ajax request by
the component and the behavior on this was of course different between
browsers. IE and Chrome had the issue, and FF didn't seem to have the issue.
 
Don't MAKE me come back there with this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic