• 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

SOLVED: prevent a page from redrawing in JSF/RichFaces

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm still not 100% on JSF/RichFaces and I'm having to debug someone else's code...

They have a "Jurisdiction Finder" that works pretty well. It lives in a rich faces modalPanel -- the modalPanel has a form that conducts some searching, and then on "OK", the window closes, and passes its value to the form on the main page section.

The trouble is it's causing the entire page to reload, clearing out anything on the page.

the ok/cancel button are as follows
<h:panelGroup style="text-align:center;">
<h:commandButton id="okBtn" value="Ok"
disabled="#{!handler.popupHandler.validSearchJurisdictionResult}"
actionListener="#{handler.updateJurisdictionListener}"
oncomplete="Richfaces.hideModalPanel('#{popupName}'); return false;"
reRender="#{reRender}">
</h:commandButton>
<rich:spacer width="20px" />
<h:commandButton immediate="true" value="Cancel"
onclick="Richfaces.hideModalPanel('#{popupName}'); return false;" />
</h:panelGroup>
the same form inside the popup is used to search itself, w/o submitting the whole page

One Weird thing is I can add a 3rd button:
<h:commandButton value="not Ok!!!" />
and it will hide the panel and reset the page... well I guess not really, I guess it's just resetting the page!

So how can I find out what's causing the whole page to be reloaded when this form is submitted? It seems to be set up to "know" what it needs to reRender..


the surrounding jurisdiction_searc.xhtml is included thus:
<ui:include src="/WEB-INF/view/components/jurisdiction_search.xhtml">
<ui:param name="handler" value="#{locationMatrixBean.filterHandler}"/>
<ui:param name="popupName" value="searchJurisdiction"/>
<ui:param name="popupForm" value="searchJurisdictionForm"/>
<ui:param name="reRender" value="locationMatrixForm:jurisInput"/>
</ui:include>

I realize this might not be enough information, but I'm just not sure how much to include...

Thanks for any suggestions!

 
kirk israel
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
AARGH - whoever wrote this put in an h:commandButton, not an a4j:commandButton. That one little change fixed the whole thing!

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
use ajaxsingle="true" so that the whole page is not refreshed.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic