function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Custom Component : Page Controller Method calling


After clinking  an action in Component controller. i would like to call and method in PageController. and rerender a pannel in Main Page.


Page Start --------


[Component Action]      ------[ onclick of this action in Component Controller this component will rerender, but how can i rerender my pannel]     




<my pannel>

</my pannel>

Page Close -------


Please Help..




still i am unable to iorn out the solution


I  have used component extensively and now i am in a fix,


any one any solution.




(Old post, I know, but for those who came looking like I did...)

If I understand the question aright, the need is to call a Main Page controller method from within a component.  In that case, there is an example of this in the Apex Developer Guide.  The example is located under References | ApexPages Namespace | Action Class.  However, since links to the online DG's always seem to break over time, here is the relevant code:

Component code:
    <apex:attribute name="actionToInvoke" type="ApexPages.Action" />
    <apex:commandButton value="Perform Controller Action" action="{!actionToInvoke}"/>
Page code:
<apex:page controller="pageCon">
    <c:myComp actionToInvoke="{!RedirectToStep2}"/>
Page Controller code:
public class pageCon{
    public PageReference RedirectToStep2() {
        // ...
        return Page.Step2;

Hope that helps!