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
snippets@sfsnippets@sf 

Custom Component : Page Controller Method calling

Hi, 

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 --------

<MyComponent>

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

</MyComponent>

 

 

<my pannel>

</my pannel>

Page Close -------

 

Please Help..

 

snippets@sfsnippets@sf

Thanks,

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.

 

 

 

doughauck-corpdoughauck-corp
(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:component>
    <apex:attribute name="actionToInvoke" type="ApexPages.Action" />
    ...
    <apex:commandButton value="Perform Controller Action" action="{!actionToInvoke}"/>
</apex:component>
Page code:
<apex:page controller="pageCon">
    ...
    <c:myComp actionToInvoke="{!RedirectToStep2}"/>
</apex:page>
Page Controller code:
public class pageCon{
    public PageReference RedirectToStep2() {
        // ...
        return Page.Step2;
    }
}

Hope that helps!
Doug