You need to sign in to do that
Don't have an account?

Adding True False Condition To Apex:actionFunction "ReRender"
Hello,
I have a scenario where I have an apex:actionFunction. This actionFunciton rerenders outputpanels in my visualforcve page.
I with to only rerender the outputPanel's based on a boolean value from my controller. If after I call my function my boolean value is true I want to rerender specific panels. If not I don't want to rerender them.
I tried this with the following but it does not seem to work correctly
reRender="{!if(priorformProcessed, 'panel1, panel2', 'testFalse')}"
The actionFunction exists in panel 1. "TestFalse" is always rerendered no matter if my boolean is true (and true in my view state).
Do you know if there is a way of dynamically providing which panels to ReRender similar to what I'm trying to do above?
I tried to use a string variable which I set in my controller to define which panels to rerender but so far I have not got this to work either (although it may be a possible approach).
Any advice/suggestions on this would be good.
Thanks.
I am stuck with a similiar issue, but I am rerendering an outputtext. I am trying to set the flag to true or false ina controller and trying to pass it to the page, I see the flag is being set but not getting passed to page.
Take a look which I have tried may be you can fix it and get it working.Let meknow if you are able to fix it
http://boards.developerforce.com/t5/Visualforce-Development/Urgent-Rerender-Issue/td-p/588529
Since your output panel is rendered according to certain condition. let it be reRender everty time, if your controller makes the value true than it will render otherwise it will not reRender.
Hi Shiv Shankar,
Thank you for your help. Will this work also for an already renreded panel. I.E. If I specify in my outputpanel
"renrded={!if(x==true && y==true)}">
- If both are true the firt time the panel is rendered.
- After my actionFunction > if one of them is not true but I do not want to hide the panel. I want to keep it rendered but do not want to rerender it. Can this work?
I would have thought the second time my panel will disappear (not be rendered at all) instead of remaining but not reRendered.
I hope that makes sense.
If you know if it should still work or of another suggestion you can let me know.
Thanks.
If we reRender it , every time it will not rendered bcz one of the condition became false.
i think if we replace AND operator with OR operator it will full fill your requirement
Like :
"renrded={!if(x==true || y==true)}">
Hi Shiv Shankar,
Thank you again for your help. I will look to see if I can change my "rendered" criteria as suggested but I'm not sure if it will meet my needs. On my initial way of putting an if statement in the "reRender" for my actionFunction. I've done some further testing on using if statements witihin a reRender and they can be sued.
If I try
reRender="{!if(true, 'panel1, panel2', 'testFalse')}"
this reRenders 'panel1' and 'panel2'
If I try
reRender="{!if(false, 'panel1, panel2', 'testFalse')}"
this reRenders 'testFalse'
In my view state my boolean variable "priorformProcessed" does display the correct required "true" or "false" value.
It's as if in my if statement in my actionFunction (or commandButton which I've tried also) it always takes this boolean to be false or null. Does it not bind correctly, or can binding of this type not be performed?
If I use an outputText on my page it displays the correct value.
I can look into the "rendered" options as you have suggested Shiv Shankar however I think I may not be able to get all scenarios I require within this to work.
Thanks again for your help & if you/anyone has any further thoughts on the above binding question you can let me know.