• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SOLVED: prevent a page from redrawing in JSF/RichFaces

 
kirk israel
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • 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
  • 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!

 
Rohit Boorugu
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
use ajaxsingle="true" so that the whole page is not refreshed.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic