Skip to main content
deleted 43 characters in body
Source Link
cropredy
  • 73.3k
  • 8
  • 128
  • 284

I'm trying to call a simple function in my Apex Controller and want to use an actionRegion to stop most sections of the page re-rendering. I note though when I add the actionRegion the controller function does not get called. I'm sure I've come across a similar issue years ago but can't find the exact same scenario detailed anywhere.

Basically here is a simple example. As you can see i've tried but commandButton and commandLink. I was trying to assign a parameter also but noted that the function is not even being called. It does call it if I don't use the actionRegion.

 <apex:actionRegion>
    <apex:commandButton rerender="testRerender" value="Select Instances"  
        <apex:commandButton rerender="testRerender" value="Select Instances" action="{!nullPageReference}" styleClass="slds-button">
           action="{!nullPageReference}" styleClass="slds-button">
        <apex:param name="editMode" value="EDIT" assignTo="{!viewMode}"/>
                </apex:commandButton>
             
    <apex:commandLink action="{!nullPageReference}" reRender="testRerender" value="SelectorS">
                    <!--<apex:param name="editMode" value="EDIT" assignTo="{!viewMode}"/>-->
            </apex:commandLink>
 </apex:actionRegion>


public PageReference nullPageReference() {
    System.debug('HelloCalledFunc');
    </apex:actionRegion>return null;
}

public PageReference nullPageReference() { System.debug('HelloCalledFunc'); return null; }

Does anyone know why this does not work and if so how I can workaround it to call the function while in an actionRegion.

Thanks in advance.

I'm trying to call a simple function in my Apex Controller and want to use an actionRegion to stop most sections of the page re-rendering. I note though when I add the actionRegion the controller function does not get called. I'm sure I've come across a similar issue years ago but can't find the exact same scenario detailed anywhere.

Basically here is a simple example. As you can see i've tried but commandButton and commandLink. I was trying to assign a parameter also but noted that the function is not even being called. It does call it if I don't use the actionRegion.

 <apex:actionRegion>
                <apex:commandButton rerender="testRerender" value="Select Instances" action="{!nullPageReference}" styleClass="slds-button">
                    <apex:param name="editMode" value="EDIT" assignTo="{!viewMode}"/>
                </apex:commandButton>
                <apex:commandLink action="{!nullPageReference}" reRender="testRerender" value="SelectorS">
                    <!--<apex:param name="editMode" value="EDIT" assignTo="{!viewMode}"/>-->
            </apex:commandLink>
            </apex:actionRegion>

public PageReference nullPageReference() { System.debug('HelloCalledFunc'); return null; }

Does anyone know why this does not work and if so how I can workaround it to call the function while in an actionRegion.

Thanks in advance.

I'm trying to call a simple function in my Apex Controller and want to use an actionRegion to stop most sections of the page re-rendering. I note though when I add the actionRegion the controller function does not get called. I'm sure I've come across a similar issue years ago but can't find the exact same scenario detailed anywhere.

Basically here is a simple example. As you can see i've tried but commandButton and commandLink. I was trying to assign a parameter also but noted that the function is not even being called. It does call it if I don't use the actionRegion.

 <apex:actionRegion>
    <apex:commandButton rerender="testRerender" value="Select Instances"  
                        action="{!nullPageReference}" styleClass="slds-button">
        <apex:param name="editMode" value="EDIT" assignTo="{!viewMode}"/>
    </apex:commandButton>
  
    <apex:commandLink action="{!nullPageReference}" reRender="testRerender" value="SelectorS">
       <!--<apex:param name="editMode" value="EDIT" assignTo="{!viewMode}"/>-->
    </apex:commandLink>
 </apex:actionRegion>


public PageReference nullPageReference() {
    System.debug('HelloCalledFunc');
    return null;
}

Does anyone know why this does not work and if so how I can workaround it to call the function while in an actionRegion.

Thanks in advance.

Source Link
RedQueries
  • 715
  • 13
  • 31

Apex:ActionRegion blocking Controller function Action

I'm trying to call a simple function in my Apex Controller and want to use an actionRegion to stop most sections of the page re-rendering. I note though when I add the actionRegion the controller function does not get called. I'm sure I've come across a similar issue years ago but can't find the exact same scenario detailed anywhere.

Basically here is a simple example. As you can see i've tried but commandButton and commandLink. I was trying to assign a parameter also but noted that the function is not even being called. It does call it if I don't use the actionRegion.

 <apex:actionRegion>
                <apex:commandButton rerender="testRerender" value="Select Instances" action="{!nullPageReference}" styleClass="slds-button">
                    <apex:param name="editMode" value="EDIT" assignTo="{!viewMode}"/>
                </apex:commandButton>
                <apex:commandLink action="{!nullPageReference}" reRender="testRerender" value="SelectorS">
                    <!--<apex:param name="editMode" value="EDIT" assignTo="{!viewMode}"/>-->
            </apex:commandLink>
            </apex:actionRegion>

public PageReference nullPageReference() { System.debug('HelloCalledFunc'); return null; }

Does anyone know why this does not work and if so how I can workaround it to call the function while in an actionRegion.

Thanks in advance.