You need to sign in to do that
Don't have an account?
Mark Young
actionRegions and Components
Hi all,
Has anyone tried to use action regions inside components before? We've got a large page which is split using tabs with the body of each tab provided by a component. In order to optimise performance (which was very slow) I have been playing with actionRegions, extensive use of variables etc.
I've found that if an actionRegion is used in conjunction with a component, then fields inside that component don't seem to correctly display the value retrieved from the controller, even though the 'get' methods are being called.
For example... I whipped up the following demo page:
Code:
<apex:page controller="TestRepeat_Controller"> <apex:form > <apex:actionRegion > <apex:pageBlock id="topSection"> <apex:pageBlockButtons > <apex:commandButton value="Click Me" rerender="bottomSection" /> </apex:pageBlockButtons> <apex:inputText value="{!input1}" /> </apex:pageBlock> </apex:actionRegion> <apex:pageBlock id="bottomSection"> <apex:outputText value="{!Current}" /> <br /> <apex:outputText value="{!input1}" /> </apex:pageBlock> </apex:form> </apex:page>
Controller:
Code:
public class TestRepeat_Controller { private String input1; public String getInput1() { return input1; } public void setInput1(String val) { input1 = val; } public String getCurrent() { return Datetime.now().format(); } }
This works great, the time shows up down the bottom along with the input from the top field.
However, if I extract the body of the page into a component and include the component then the time no longer shows after a postback (the input value does though).
Am I doing something wrong here?