Skip to main content

#Visualforce10 discussing

http://www.salesforce.com/us/developer/docs/pages/index.htm
Hi, i created a static resource to attach my logo in salesforce.then i copied the url and inserted in vf page .

i used the following code

<img src="https://ayush--recruitmen--c.visualforce.com/resource/1659528741000/ayushLogo?" style="width:250px;height:50px;" />.

My logo is not visible .it showing like this in preview . can anyone tell me why it is not visible. the image which i attached was jpeg format.

how to insert logo in vfpage?

thanks in advance
4 answers
  1. Aug 8, 2022, 9:33 AM
    Hi Suji,

    Please follow below concepts

    apex:image A graphic image, rendered with the HTML <img> tag.

    Example

    <apex:image id="theImage" value="/img/myimage.gif" width="220" height="55"/>

    The example above renders the following HTML:

    <img id="theImage" src="/img/myimage.gif" width="220" height="55"/>

    Resource Example

    <apex:image id="theImage" value="{!$Resource.myResourceImage}" width="200" height="200"/>

    The example above renders the following HTML:

    <img id="theImage" src="<generatedId>/myResourceImage" width="200" height="200"/>

    Zip Resource Example

    <apex:image url="{!URLFOR($Resource.TestZip, 'images/Bluehills.jpg')}" width="50" height="50" />

    The example above renders the following HTML:

    <id="theImage" src="[generatedId]/images/Bluehills.jpg" width="50" height="50"/>

    if you need any assistanse, Please let me know!!

    Kindly mark my solution as the best answer if it helps you.

    Thanks

    Mukesh
0/9000
Hi Everyone,

 I have created a google map to show a route between 2 points

and it is working fine

but I want to set the zoom level according to these 2 points so I can see complete route 

do you have any idea how to do this

 

<apex:page standardController="sustain_app__EnergyConsumption__c" extensions="Rg_DistanceCalculator">

<html>

<head>

<style>

⌗map-layer {

max-width: 1500px;

min-height: 550px;

}

.lbl-locations {

font-weight: bold;

margin-bottom: 15px;

}

.locations-option {

display:inline-block;

margin-right: 15px;

}

.btn-draw {

background: green;

color: ⌗ffffff;

}

</style>

<script src="https://code.jquery.com/jquery-3.2.1.js"></script>

</head>

<body>

<div id="map-layer"></div>s

<script>

var map;

var waypoints;

function initMap() {

console.log('Init Method..! ');

var mapLayer = document.getElementById("map-layer");

var centerCoordinates = new google.maps.LatLng(39.888250,-83.088370);

var defaultOptions = { center: centerCoordinates, zoom: 8,scrollwheel: true, }

map = new google.maps.Map(mapLayer, defaultOptions);

var directionsService = new google.maps.DirectionsService;

var directionsDisplay = new google.maps.DirectionsRenderer;

directionsDisplay.setMap(map);

var addressArray = {!listOfAddresses}; // Use this format to fill addressArray

var start =addressArray[0];

var end = addressArray[1];

console.log('Start : ',start);

console.log('end : ',end);

setTimeout(function(){

drawPath(directionsService, directionsDisplay,start,end);

}, 2000);

}

function drawPath(directionsService, directionsDisplay,start,end) {

console.log('Drawing Path !!!!!');

console.log(start+' '+end);

directionsService.route({

origin: start,

destination: end,

optimizeWaypoints: true,

travelMode:'DRIVING'

}, function(response, status) {

if (status === 'OK') {

directionsDisplay.setDirections(response);

} else {

console.log('Problem in showing direction due to ' + status);

}

});

}

</script>

<script src="https://maps.googleapis.com/maps/api/js?key=*********************************************callback=initMap">

</script>

</body>

</html>

</apex:page>

Thank You

Rahul​​​​​​​
2 answers
  1. Mar 16, 11:49 AM

    Hello,  Just add map.fitBounds(response.routes[0].bounds); inside your drawPath function's success callback, right after you set the directions. This uses the route's built-in coordinates to automatically snap the camera to the perfect zoom level that keeps both points on screen. Also, keep an eye on your script URL 

0/9000

There are only 23 calendar days left to prepare for the Spring '26 Release ! 

 

Check out Salesforce Spring ‘26 Release: What to Expect and How to Prepare ahead of time to ensure the following features don't break; 

 

  • Calculate Tax-Only and Product-Only Price Adjustments
  • Escape the Label Attribute of <apex:inputField> Elements to Prevent Cross-Site Scripting in Visualforce Pages
  • Update Instanced URLs in API Traffic
  • Migrate to a Multiple-Configuration SAML Framework
  • Restrict User Access to Run Flows

 

#Salesforce Developer #Flow #Salesforce Admin #Sales Cloud #Salesforce #TrailblazerCommunity #Salesforce Platform #SAML #Visualforce

 

@* Salesforce Administrators * @Trailblazer Community Cove @* Salesforce Platform * @* Customer Success * @* Salesforce Developers * @Architect Trailblazers @Salesforce Flow Automation

2 comments
  1. Dec 17, 2025, 12:32 PM

    Hello, Spring ’26 Release—now’s the time to prepare. 

    Review upcoming changes early to prevent broken

0/9000

I have a problem with accessing individual products on our Marketplace site. It’s built on experience cloud.

The external site is presented in an iframe wrapped in a visualforce page. As a result when a specific products url is clicked rather than go to that product it returns to the home page.

For example to get to the product page for Google Workspace, its link is

https://www.aitechsourcing.com?bf_redirect=%252Fgoogle-google-workspace

However when that is clicked the home page not the product page is returned. That page is

https://AITechSourcing.com

.

Can anyone offer me recommendations on how to have the specific product pages available to display when their link is clicked?

Thanks.

Pete

#Experience Cloud #VisualForce Page #Visualforce #Iframe Src #Iframe
2 comments
  1. Dec 28, 2024, 6:22 AM

    Hi Pete,

    Here are a few recommendations that might help resolve this issue:

    1. Check URL Encoding: Ensure that the URL parameters are correctly encoded. Sometimes, special characters in URLs can cause unexpected behavior.
    2. Verify X-Frame-Options: Ensure that the external site allows being displayed in an iframe. Some websites set the X-Frame-Options HTTP header to prevent being embedded in iframes. You can check this by inspecting the network requests in your browser's developer tools.
    3. Use Apex:iframe: If you're not already using it, consider using the apex:iframe component instead of a standard iframe. This component is designed for embedding external content in Visualforce pages and might handle URL parameters better1.
    4. Update Visualforce Page: Ensure that your Visualforce page is correctly configured to handle URL parameters. You might need to adjust the URL handling logic in your Visualforce page to ensure it correctly parses and redirects to the desired product page.
    5. Test in Different Browsers: Sometimes, browser-specific behaviors can cause issues with iframes. Test the behavior in different browsers to see if the issue persists.
0/9000
We have a customer experience with a custom login page.  I have updated the guest user profile to have access to the apex classes and visualforce pages upon login.  When I test as a user (incog window) and try to login I get this error :

Error:

Your login attempt has failed. Make sure the username and password are correct.

I then click forgot my password and reset the password and it logs me in.  When I log out and then try and log back in it throws the same error:

Error:

Your login attempt has failed. Make sure the username and password are correct.

I have double and tripple checked the apex class and visualforce access for both the guest user profile and the actual user profile and it still isn't working.  

Does anyone have any idea what might be going on?
4 answers
  1. Jan 29, 5:45 AM

    ADP TotalSource is a game-changer for managing HR efficiently, and I’ve seen firsthand how it simplifies payroll processing and benefits administration for small businesses. Throughout this post, we covered key aspects like ADP TotalSource Login, ADP TotalSource Features, Payroll and Benefits Management, HR Compliance, and Employee Self-Service. 

     

0/9000
Hey folks,

I'm using  style="-fs-table-paginate: paginate;" on my apex:pageBlockTable and it is successfully adding my header row to each page of my PDF, BUT, it is also showing the footer facet on every page, which I do not want. I want the total row to appear only on the final page. Any tips on how to achieve this would be most appreciated. Here is a cut-down version of my page.

<apex:page renderAs="PDF" controller="PaymentAdviceController" applyBodyTag="false" applyHtmlTag="false" showHeader="false">

    <head>

       <style>

        @page {

             margin: 1in;

             size: 25in 15in;

             @bottom-center {

                font-family: Dialog;

                content: "Page " counter(page) " of " counter(pages);

            }

           }

        .col1 {width:160px; text-align:left;}

        .col2 {width:1800px; text-align:center;}

        .col3 {width:220px; text-align:right;}

        .headerRow .TableTitleCenter {

            background-color: ⌗ff5b5b;

            font-family: Dialog;

            text-align:center;

            padding:4px;

        }

        .headerRow .TableTitle {

            background-color: ⌗ff5b5b;

            font-family: Dialog;

            padding:4px;

        }

        .tableCell{

            page-break-inside: avoid;

        }

       </style>

    </head>

    <apex:panelGrid columns="3" columnClasses="col1,col2,col3">

        <img src="{!$Resource.DDLogo}" height="143px" width="223px" align="left" />

        <apex:panelGrid columns="2" width="100%" style="font-weight:bold;font-family: Dialog;font-size:25px">Telstra Commissions Payment Advice</apex:panelGrid>

        <apex:panelGrid columns="1" width="100%" style="font-style:bold;font-family: Dialog;">

            <apex:outputText value="{0, date,  dd/MM/yyyy}" >Date Processed: <apex:param value="{!dateFriday}" /></apex:outputText>

        </apex:panelGrid>

    </apex:panelGrid>

    <apex:pageBlock>

        <apex:pageBlockTable value="{!Payments}" var="payment" border="1px" width="100%" cellpadding="0px" style="-fs-table-paginate: paginate;">

            <apex:column headerValue="Account Number" headerClass="TableTitleCenter" style="font-family: Dialog;text-align:center;font-size:13px;padding:4px;">

                <apex:outputText value="{!payment.Expected_Commission__r.Project__r.Account__r.AccountNumber}" style="tableCell" />

                <apex:facet name="footer">

                    <div style="font-family: Dialog;font-size:13px;text-align:right;font-weight:bolder;background-color: ⌗ebebeb;padding:4px;">&nbsp;</div>

                </apex:facet>

            </apex:column>

            <apex:column headerValue="Total Ex GST" headerClass="TableTitleCenter" style="font-family: Dialog;font-size:13px;text-align:right;padding:4px;">

            <apex:outputText value="{0, number, Currency}" style="tableCell"><apex:param value="{!payment.Dealer_CN_to_be_raised_Ex__c}" /></apex:outputText>

                <apex:facet name="footer">

                    <div style="font-family: Dialog;font-size:13px;text-align:right;font-weight:bolder;background-color: ⌗ebebeb;padding:4px;">${!exclGST}</div>

                </apex:facet>

            </apex:column>

            <apex:column headerValue="Total Inc GST" headerClass="TableTitleCenter" style="font-family: Dialog;font-size:13px;text-align:right;padding:4px;" >

                <apex:outputText value="{0, number, Currency}" style="tableCell"><apex:param value="{!payment.Dealer_Total_Inc_GST__c}" /></apex:outputText>

                <apex:facet name="footer">

                    <div style="font-family: Dialog;font-size:13px;text-align:right;font-weight:bolder;background-color: ⌗ebebeb;padding:4px;">${!inclGST}</div>

                </apex:facet>

            </apex:column>

            <apex:column headerValue="Credit Note Number" headerClass="TableTitleCenter" style="font-family: Dialog;text-align:center;font-size:13px;padding:4px;">

                <apex:outputText value="{!payment.Credit_Note__c}" style="tableCell" />

                <apex:facet name="footer">

                    <div style="font-family: Dialog;font-size:13px;text-align:right;background-color: ⌗ebebeb;padding:4px;">&nbsp;</div>

                </apex:facet>

            </apex:column>

        </apex:pageBlockTable>

    </apex:pageBlock>

    <br/>

    <apex:outputText style="font-family: Dialog;font-size:12px" value="Some trailing text here:"/>

    <br/>

</apex:page>
3 answers
  1. Feb 2, 7:26 AM

    Hello, 

    To stop the footer from repeating, you should

    remove the <apex:facet name="footer"> tags from inside the table and place your totals in a separate <div> or <table> immediately following the </apex:pageBlockTable>.

    This works because the -fs-table-paginate property specifically forces <thead> and <tfoot> elements (which facets generate) to repeat on every page break; moving the data outside the table context ensures it only renders once at the very end of your data list.

0/9000
Hi Everyone,

Currently my VF page is run in synchronous mode now my requiremnt is that VF page will run asynchronously using callouts.

Any one have idea about this requirement please help me out.Below is the VF page and Controller.

=================================================================

VF page

<apex:page standardController="Opportunity" extensions="StudentDocumentsController" > 

    <link rel="stylesheet" href="{!URLFOR($Resource.JSTree1,'vakata-jstree-b83e2f6/dist/themes/default/style.min.css')}" />

    <script src="{!URLFOR($Resource.JSTree1,'vakata-jstree-b83e2f6/dist/libs/jquery.js')}"></script>

    <script src="{!URLFOR($Resource.JSTree1,'vakata-jstree-b83e2f6/dist/jstree.min.js')}"></script>

    <script type="text/javascript"> 

        var myWindow;

        function testfnx(documentId) {

            var docId = documentId.split("_");

            var u = '{!OrionODIViewerURL}' + docId[0] +'&syStudentID='+docId[1]+'&diDocumentsScheduledID='+docId[2]+'&diDocumentID='+docId[3]+'&syCampusID='+docId[4];//documentId;

            window.open(u);

        }

        window.onload = function (){

            //DocumentCallDefault();

        }

        function getTasks() {

            window.open("/apex/DisplayStudentTask?Id={!Id}",'Popup','height=400,width=1000,left=100,top=100,scrollbars=yes,toolbar=no,status=no'); 

        }

    </script>

    <script type="text/javascript">

        var jq1 = $.noConflict();

    </script>

    <style>

        span.tooltip {

            outline:none;

            escape:false; 

        }

        

        span.tooltip:hover {

            text-decoration:none;

            cursor: pointer;

        } 

        span.tooltip span {

            z-index:10;display:none; padding:14px 20px;

            margin-top:-50px; margin-left:18px;

            line-height:16px;

            border-radius:4px;

            -moz-border-radius: 4px;

            -webkit-border-radius: 4px;

                

            -moz-box-shadow: 5px 5px 8px ⌗CCC;

            -webkit-box-shadow: 5px 5px 8px ⌗CCC;

            box-shadow: 5px 5px 8px ⌗CCC;

        }

        span.tooltip:hover span{

            display:inline; position:absolute; color:⌗000000;

            border:1px solid ⌗000000; background:⌗CCCCCC; opacity:0.95;}//border:1px solid ⌗DCA; background:⌗D6F5F5; opacity:0.85;

        }

    </style>

    <apex:form id="wrap">

        <apex:actionFunction action="{!DocumentCallDefault}" name="DocumentCallDefault" status="callWebService" reRender="wrap,json,json1" oncomplete="Tree1();"/>

        <apex:actionFunction action="{!DocumentCallAll}" name="DocumentCallAll" status="callWebService" reRender="wrap,json,json1"  oncomplete="Tree2();"/>

        <apex:inputHidden value="{!jsonStr}" id="json"/>

        <apex:inputHidden value="{!jsonStr1}" id="json1"/>

        <apex:pageBlock id="docTree" tabStyle="Opportunity">

            <div style="text-align: center;">

                <input value="Load Student Documents" class="btn" title="Load Student Documents" name="load_student_documents" onclick="javascript:DocumentCallDefault();" type="button" />   

                <apex:commandbutton value="Get C-Code/Verification Tasks"  onclick="getTasks();"/>

                <apex:actionStatus id="callWebService">

                    <apex:facet name="stop">

                    </apex:facet>

                    <apex:facet name="start">

                        <apex:outputPanel >

                             &nbsp;<apex:image value="{!$Label.Image}" style="height: 16px; margin-top; 2px;"/>

                        </apex:outputPanel>

                    </apex:facet>

                </apex:actionStatus>

            </div>

            

            <table width="100%">

                <tr>

                    <td width="50%">

                        <div style="margin-top: 3px;margin-right: 0px;margin-bottom: 0px;margin-left: -2px;font-size: 1.0em;" width="100%" align="left"><b>Student {!currOpp.Account.Name}&apos;s Documents</b></div>

                    </td>

                    <td width="50%">

                        <div style="margin-top: 3px;margin-right: 0px;margin-bottom: 0px;margin-left: -8px;font-size: 1.0em;" width="100%" align="right"><b>Academic File Status: <img src="{!fileStatus}" width="12" hieght="12"/> {!fileStatusText}</b></div>

                    </td>

                </tr>

            </table>

            <apex:tabPanel switchType="client" value="{!selectedTab}">

                <apex:tab label="Default" name="Default" ontabenter="DocumentCallDefault()">

                    <div class="jstree1">

                    </div>

                </apex:tab>

                <apex:tab label="All" name="All" ontabenter="DocumentCallAll()">

                    <div class="jstree2">

                    </div>

                </apex:tab>

            </apex:tabPanel>

        </apex:pageBlock>

        <script>

            function Tree1(){

                var parsedJson = jq1.parseJSON(document.getElementById("{!$Component.wrap:json}").value);

                jq1('.jstree1').jstree(parsedJson);

            }

            function Tree2(){

                var parsedJson = jq1.parseJSON(document.getElementById("{!$Component.wrap:json1}").value);

                jq1('.jstree2').jstree(parsedJson);

                Tree1();

            }

        </script>

    </apex:form> 

</apex:page>

    

   

           

 
3 answers
  1. Oct 29, 2025, 7:55 AM

    To move your Visualforce (VF) page callouts to an **asynchronous** model, you must use **`@future(callout=true)`** Apex methods, as direct callouts from synchronous controller actions (like those choice advantage linked to `apex:actionFunction`) are forbidden. The overall architecture requires four steps: 1) The VF page's `apex:actionFunction` calls a new synchronous controller method (`DocumentCallDefaultAsync`). 2) This synchronous method immediately calls a separate static **`@future` method** (in a service class) to execute the actual external web service callout and stores the result (e.g., the JSON string) in a database record (like a custom status object). 3) The VF page uses an **`apex:actionPoller`** to periodically call a second synchronous controller method (`checkCalloutStatus`). 4) This status check method reads the database record; once it confirms the JSON result is present and the status is 'COMPLETE', the poller stops and the client-side JavaScript (e.g., `Tree1()`) renders the tree using the retrieved data.

0/9000
3 answers
  1. Nov 5, 2025, 10:43 AM

    Hello @Stephen A Amison @ E-ZPassFL

    You can add text-to-speech to your Visualforce page using the Web Speech API. Just include a JavaScript snippet that uses `speechSynthesis.speak()` to read content aloud. Ensure your markup is accessible and compliant with WCAG/508 standards for best results. 

     

    Best Regards, 

    Leah Santos 

     

0/9000
Hi Everyone,

I am a newbie to Salesforce and have been assigned the following task:

  1. Create a VF page where the list of users in the system is listed.

    1. Users should be able to select multiple Users and click on the ‘Reset password’ button. Upon click, Password reset mail should be sent to the selected users.
    2. Pagination should be available
    3. Number of user-selected should be displayed as available in Standard list view

I have create following VF page:

<apex:page standardController="User" extensions="dataTableCon" sidebar="false">

   <apex:form >

      <head>

         <title>Users - Detail Page</title>

         <apex:stylesheet value="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.2/css/bootstrap.min.css"/>

         <apex:stylesheet value="https://use.fontawesome.com/releases/v5.3.1/css/all.css"/>

         <apex:stylesheet value="{!$Resource.TicketingCSS}"/>

         <style class="INLINE_PEN_STYLESHEET_ID">

            .container {

            padding: 1.3rem 0rem;

            }

            h4 {

            margin: 1.3rem 0rem 0.6rem;

            }

            .table-image td, .table-image th {

            vertical-align: middle;

            }

            body {

            counter-reset: Count-Value;     

            }

            tr td:nth-child(2):after {

            counter-increment: Count-Value;   

            content: counter(Count-Value);

            }

            th, td {

            text-align:center;

            font-size:0.9rem;

            }

         </style>

         <script src="https://static.codepen.io/assets/editor/iframe/iframeConsoleRunner-dc0d50e60903d6825042d06159a8d5ac69a6c0e9bcef91e3380b17617061ce0f.js"></script>

         <script src="https://static.codepen.io/assets/editor/iframe/iframeRefreshCSS-e03f509ba0a671350b4b363ff105b2eb009850f34a2b4deaadaa63ed5d970b37.js"></script>

         <script src="https://static.codepen.io/assets/editor/iframe/iframeRuntimeErrors-29f059e28a3c6d3878960591ef98b1e303c1fe1935197dae7797c017a3ca1e82.js"></script>

      </head>

      <body>

         <p style="text-align:center;font-size:1.3rem;padding-top:10px;"> User Password Reset System </p>

         <div class="container">

            <div class="row">

               <div class="col-12">

                  <table class="table table-bordered">

                     <thead>

                        <tr>

                           <th scope="col">Select User</th>

                           <th scope="col">S.No.</th>

                           <th scope="col">Full Name</th>

                           <th scope="col">Alias</th>

                           <th scope="col">Username</th>

                           <th scope="col">Role</th>

                           <th scope="col">Profile</th>

                        </tr>

                     </thead>

                     <apex:repeat value="{!Users}" var="user">

                        <tbody>

                           <tr>

                              <td style="white-space:nowrap;">

                                 <div class="custom-control custom-checkbox">

                                    <apex:inputCheckbox value="{!userForReset}" styleClass="custom-control-input" id="customCheck1">

                                       <apex:actionSupport event="onclick"

                                          action="{!handleuserCheckboxChange}"

                                          reRender="ResultPanel">

                                          <apex:param id="user" name="userId" value="{!User.Id}"

                                             assignTo="{!objSelectedUserId}"/>

                                       </apex:actionSupport>

                                    </apex:inputCheckbox>

                                    <apex:outputLabel styleClass="custom-control-label" for="customCheck1"/>

                                 </div>

                              </td>

                              <td></td>

                              <td>{!user.Name}</td>

                              <td>{!user.Alias}</td>

                              <td>{!user.UserName}</td>

                              <td>{!user.UserRole.Name}</td>

                              <td>{!user.Profile.Name}</td>

                           </tr>

                        </tbody>

                     </apex:repeat>

                  </table>

               </div>

            </div>

         </div>

         <div align="center" draggable="false" >

            <apex:commandButton id="btn" action="{!resetpass}" value="Reset Password(s)" styleClass="submit-btn"/>

         </div>

         <p style="text-align:right;font-size:1rem;padding-bottom:10px;padding-right:100px;">Page 1 of </p>

         <script src="https://static.codepen.io/assets/common/stopExecutionOnTimeout-157cd5b220a5c80d4ff8e0e70ac069bffd87a61252088146915e8726e5d9f147.js"></script>

         <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>

         <script type="text/javascript">

            $(function () {

                //Assign Click event to Button.

                $("⌗btn").click(function () {

                    var message = "Name Username Profile\n";

            

                    //Loop through all checked CheckBoxes in GridView.

                    $("⌗Table1 input[type=checkbox]:checked").each(function () {

                        var row = $(this).closest("tr")[0];

                        message += row.cells[3].innerHTML;

                        message += "   " + row.cells[4].innerHTML;

                        message += "   " + row.cells[6].innerHTML;

                        message += "\n";

                    });

            

                    //Display selected Row data in Alert Box.

                    alert(message);

                    return false;

                });

            });

         </script>      

      </body>

   </apex:form>

</apex:page>

Controller:

public class dataTableCon {

    List<User> users;

    public User userForReset {get;set;}

    public static System.ResetPasswordResult result;

    public System.PageReference pr;

      

    public dataTableCon(ApexPages.StandardController controller) {

        userForReset = (User) controller.getRecord();

    }

    

    public Id objSelectedUserId {get;set;}

    public void handleuserCheckboxChange() {

        for(User objStudent: users) {

            if(objStudent.Id == objSelectedUserId){

                system.debug('-----This is the selected student record----'+objStudent);

            }

        }

    }

    public List<User> getUsers() {

        if(users == null)

            users = [SELECT Name, Email, UserName, Alias, Profile.Name, UserRole.Name, IsActive FROM User WHERE Username <> NULL];

        return users; 

    }

    

    public PageReference resetpass() {

        if (userForReset != NULL) {

            try{

                users = [Select Email FROM User WHERE Id=:userForReset.Id];

                Boolean email = true;

                for(User u : users) {

                    result = System.resetPassword(u.Id, email);

                }

            }

            catch(Exception e) {

            }

                pr = Page.ResetPassword;

              

        }

        return pr;

    }

}

Can anyone please help by checking the code for errors?

1 answer
  1. Nov 3, 2025, 11:29 AM

    Hello, 

     

    This VF page structure incorporates all requirements: data table, checkbox, reset button, count display, and pagination controls. 

     

    HTML 

     

    <apex:page standardController="User" extensions="dataTableCon" sidebar="false"> 

        <apex:form > 

             

            <apex:pageMessages />  

             

            <apex:commandButton action="{!resetPasswords}" value="Reset Password" styleClass="btn btn-primary mb-3"/> 

             

            <div id="selectedCountDiv" style="font-weight: bold; margin-bottom: 10px;"> 

                {!selectedUserCount} item(s) selected | Showing:  

                {!((pageNumber - 1) * pageSize) + 1}-{!MIN(pageNumber * pageSize, totalUserCount)} of {!totalUserCount} items 

            </div> 

     

            <apex:pageBlock > 

                <apex:pageBlockTable value="{!wrappedUsers}" var="wUser" id="userTable"> 

                     

                    <apex:column headerValue="Select"> 

                        <apex:inputCheckbox value="{!wUser.isSelected}"> 

                            <apex:actionSupport event="onclick" reRender="selectedCountDiv"/>  

                        </apex:inputCheckbox> 

                    </apex:column> 

                     

                    <apex:column headerValue="Name" value="{!

    wUser.userRecord.Name

    }"/> 

                    <apex:column headerValue="Username" value="{!wUser.userRecord.Username}"/> 

                    <apex:column headerValue="Email" value="{!wUser.userRecord.Email}"/> 

                    <apex:column headerValue="Is Active" value="{!wUser.userRecord.IsActive}"/> 

                     

                </apex:pageBlockTable> 

     

                <div style="text-align: center; padding-top: 10px;"> 

                    <apex:commandButton action="{!previousPage}" value="Previous" rendered="{!hasPrevious}" reRender="userTable, selectedCountDiv" style="margin-right: 5px;"/> 

                    Page: {!pageNumber} 

                    <apex:commandButton action="{!nextPage}" value="Next" rendered="{!hasNext}" reRender="userTable, selectedCountDiv" style="margin-left: 5px;"/> 

                </div> 

                 

            </apex:pageBlock> 

             

        </apex:form> 

    </apex:page> 

     

    E-ZPass Delaware

0/9000
I have created 'List Button' from Setup -> Contact object.

On that button click i have call one new created visualforce page.

When i click on button i want to show spinner on new visualforce page untill my backend apex class loads the data.

I have called my apex class using extension and action in <apex:page> tag.
2 answers
  1. Nov 4, 2025, 9:57 AM

    Hello @Salesforce Newbee E-ZPass Illinois

    To show a spinner until your Apex class loads data, use <apex:actionStatus> with <apex:page>'s action attribute. Wrap your content in <apex:outputPanel> and bind it to the action status. Example:

    <apex:actionStatus id="loadStatus">

    <facet name="start">

    <img src="/img/loading.gif" alt="Loading..." />

    </facet>

    </apex:actionStatus>

    <apex:outputPanel id="content" layout="block" rendered="{!NOT(ISNULL(data))}" >

    <!-- Your page content here -->

    </apex:outputPanel>

    Then link it to your action:

    <apex:page controller="YourController" action="{!loadData}" >

    <apex:form>

    <apex:actionFunction name="loadData" action="{!loadData}" status="loadStatus" />

    </apex:form>

    </apex:page>

    This will show the spinner until loadData completes. 

     

    Best Regards, 

    Delia Guzman 

     

0/9000