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
Neel Kamal 6Neel Kamal 6 

Action Support unable to call action on click on checkbox. Checkbox is under apex:panelGrid.

I saw many post regarding this issue but non of them calling action support from apexgridPanel.
PageBlock have 2 coloumn but in one row I have to display two checkbox in one coloumn so I used gridPanel for this.
On click of check I have to hide and display one pageblock section. So On click of checkbox I am calling action hideDisplayLOB using
action support but actionsupport unable to hit action on controller.

Visualforce page(I can't provide full code) - 
<apex:pageBlockSectionItem id="uatSection">
                    <apex:outputLabel value="User Account Type" />
                    <apex:panelGrid columns="5" id="pg">
                        <apex:outputLabel value="Admin"/>
                        <apex:inputCheckbox id="admin" value="{!hsProvi.Admin__c}" disabled="{!isAdminDisable}" />                        
                         <apex:outputLabel value="User"/>
                         <apex:actionRegion>
                             <apex:inputCheckbox id="user" value="{!hsProvi.User__c}" disabled="{!isUserDisable}"/>
                             <apex:actionSupport  event="onclick" reRender="sslob" action="{!hideDisplayLOB}"></apex:actionSupport>
                         </apex:actionRegion>
                   </apex:panelGrid>                   
                </apex:pageBlockSectionItem> 
                   <apex:pageBlockSectionItem >
                    <apex:outputLabel value="Admin Role"/>
                    <!-- apex:outputLabel value="{!roleList}" /-->
                     <apex:selectList id="adminRole" value="{!roleName}" size="1" disabled="true">
                        <apex:selectOptions value="{!roleOptions}"/>
                    </apex:selectList>
                </apex:pageBlockSectionItem>
                <apex:pageBlockSectionItem id="ss" rendered="{!lobDisplay}">
                    <apex:outputPanel id="sslob">
                    <apex:outputLabel value="Line of Business"/>
                    <apex:inputField id="lob" value="{!hsProvi.HS_Line_of_Business__c}" />
                       </apex:outputPanel>
                </apex:pageBlockSectionItem>  

Cotroller
public pageReference hideDisplayLOB(){
         System.debug('Hide Dispaly LOB');
         if(hsProvi.User__c) {
             lobDisplay = true;
         }
         else {
             lobDisplay = false;
         }
         return null;
     }
 
Best Answer chosen by Neel Kamal 6
Dileep KumarDileep Kumar

Hi Neel Kaml,

<apex:actionRegion>
         <apex:inputCheckbox id="user" value="{!hsProvi.User__c}" disabled="{!isUserDisable}">
         <apex:actionSupport  event="onclick" reRender="sslob" action="{!hideDisplayLOB}"/>
         </apex:inputCheckbx>   
 </apex:actionRegion>

This is correct code .please put this code in your page and try now.

If you will face any problem please let me know.

If it will useful please mark it as a best answer.

Thanks,

Dileep