-
1. Re: Updating bean properties on submission of a button from different form
nbelaevski Apr 30, 2010 3:30 PM (in response to lenyas66)Hi Leonid,
Only inputs that reside in the current form are submitted to the server, thus you are loosing values. s a workaround you can submit arbitrary form (still only one) by placing a4j:jsFunction in it.
-
2. Re: Updating bean properties on submission of a button from different form
lenyas66 Apr 30, 2010 4:56 PM (in response to nbelaevski)I see. Makes sense.
-
3. Re: Updating bean properties on submission of a button from different form
lenyas66 Jun 4, 2010 4:37 PM (in response to lenyas66)Hi Nick,
I noticed another problem: when I try to re-render objects located on 2 forms only objects located on one form are re-rendered.
Please see attached XHTML file. This button points to components located on 2 forms.
<
a4j:commandButton id="loadTemplate" value="Load"
action="#{qtBeanParam.loadTemplate}" immediate="true"
reRender="selectedProducts,grossnet,sectorSel,periodicity,periodType,timePanel,selectStatistics,sortingPanel"
styleClass="blue-button">
</a4j:commandButton>
Only first component ("selectedProducts") is re-rendered. I verified that all bean values are changed correctly on the server.
Is there a way around it?
Thanks,
Leonid
-
piQueryToolCommon.xhtml.zip 3.8 KB
-
-
4. Re: Updating bean properties on submission of a button from different form
ilya_shaikovsky Jun 7, 2010 7:22 AM (in response to lenyas66)do you using region's? renderRegionOnly=true could cause this.
-
5. Re: Updating bean properties on submission of a button from different form
ilya_shaikovsky Jun 7, 2010 7:26 AM (in response to ilya_shaikovsky)sorry.. looked for attached sources and seems things looks fine... What do you see in a4j:log related to re-rendering? Because in similar case but for poll reRendering between forms - works http://livedemo.exadel.com/richfaces-demo/richfaces/poll.jsf
-
6. Re: Updating bean properties on submission of a button from different form
lenyas66 Jun 7, 2010 5:18 PM (in response to ilya_shaikovsky)Ilya,
It doesn't seem that the issue was with 2 different forms, but still I was unable to figure out what was causing it.
Since I needed pretty much whole page, which consists of two forms, to be re-rendered, I used workaround and did it from the bean as follows (see function below).
Not sure, if it is the best solution, but it worked for me. I attached XHTML file as well.
private
String cleanReRender() {
final ExternalContext ectx = FacesContext.getCurrentInstance().getExternalContext();
// final HttpSession session = (HttpSession)ectx.getSession(false);
// session.invalidate();
String sPageLink;
if ( reportType == "P")
{
sPageLink =
"/piQTPerformanceReturns.faces";
}
else
{
sPageLink =
"/piQueryTool.faces";
}
final HttpServletResponse response = (HttpServletResponse)ectx.getResponse();
try {
response.sendRedirect(sPageLink);
}
catch (IOException e) {
logger.error("Problem redirect to original page. Please contact IT support.");
}
return sPageLink;
}
-
piQueryToolCommon.xhtml.zip 3.9 KB
-