You need to sign in to do that
Don't have an account?

Loading Message on VF page
I would like to diisplay a loading message to let the users know the data is being loaded. I found some code online that it sounds like should work, but I am not getting a message displayed. The users click on a tab in Community to get the page to load. I am hoping someone has a suggestion as to what I need to change to get a loading message. Below is my code.
<apex:page showHeader="false" action="{!load}" standardStylesheets="true" standardController="account" extensions="DisplayContactExpertise" sidebar="false" docType="html-5.0" applyBodyTag="False" applyHtmlTag="False"> <style type="text/css"> body { background-color: white; } .pbTitle { white-space:nowrap; border:white; } </style> <form> <apex:repeat value="{!skills}" var="skill"> <apex:pageBlock title="{!skill}" > <apex:pageBlockSection columns="1" > <apex:actionStatus id="mystatus" startText="Loading....."> <apex:facet name="stop"> <apex:outputPanel id="out"> <apex:pageBlockTable align="center" border="3" value="{!contactskills}" var="contactskill" columnsWidth="200px, 200px, 400px"> <apex:column headerValue="Organization" rendered="{!IF(skill == contactskill.mkskill__r.name, true, false)}"> <apex:outputLink style="text-decoration:none" value="/{!contactskill.contact__r.ID}">{!contactskill.contact__r.name}</apex:outputLink> </apex:column> <apex:column headerValue="Organization" rendered="{!IF(skill == contactskill.mkskill__r.name, true, false)}"> <apex:outputLink style="text-decoration:none" value="/{!contactskill.contact__r.ID}">{!contactskill.contact__r.email}</apex:outputLink> </apex:column> <apex:column headerValue="Organization" rendered="{!IF(skill == contactskill.mkskill__r.name, true, false)}"> <apex:outputLink style="text-decoration:none" value="/{!contactskill.contact__r.ID}">{!contactskill.contact__r.account.name}</apex:outputLink> </apex:column> </apex:pageBlockTable> </apex:outputPanel> </apex:facet> </apex:actionStatus> </apex:pageBlockSection> </apex:pageBlock> </apex:repeat> </form> </apex:page>
You probably used this code: https://eltoro.secure.force.com/ShowAnImageWhileThePageIsLoading
You have forgotten the call of the action status itself. It is quite tricky. You always need a caller of the action status using the attribute : status.
When a page is loaded, the javascript function call at the end of the page is executed (here the call to the funciton sayHello). This javascript function call is associated with an action Function of your Visualforce named also sayHello which is real caller of the action status itself myStatus
<apex:form ID="TheForm">
<apex:actionStatus id="mystatus" startText="Loading.....">
<apex:actionFunction name="sayHello" action="{!load}" rerender="TheForm" status="mystatus"/>
<script> sayHello(); </script>
Finally:
- Remove the action: <apex:page showHeader="false"
- Replace <form> </form> with <apex:form ID="TheForm"> </apex:form>
- Add the code below around : </apex:form>
That should work.action="{!load}"standardStylesheets="true" standardController="account"A simpler sample: https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_actionFunction.htm
apex:actionFunction: A component that provides support for invoking controller action methods directly from JavaScript code using an AJAX request.
Attribute: name String The name of the JavaScript function that, when invoked elsewhere in the page markup, causes the method specified by the action attribute to execute. When the action method completes, the components specified by the reRender attribute are refreshed.
Regards
<apex:actionStatus id="mystatus" startText="Loading.....">
<apex:facet name="stop"> // return of the loading
<apex:outputPanel id="out">
...
// result when the loading is complete (return of {!load} here) : you complete VF page.
...
</apex:outputPanel>
</apex:facet>
</apex:actionStatus>
If you move </apex:actionStatus> and </apex:facet>, you use another technique (perhaps more standard and simpler but that could not work as expected now)
Facets: stop The components that display when an AJAX request completes. Use this facet as an alternative to the stopText attribute. Note that the order in which a stop facet appears in the body of an actionStatus component does not matter, because any facet with the attribute name="stop" controls the appearance of the actionStatus component when the request completes.
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_actionStatus.htm
There is an error here:
rendered="{!IF(skill.NameSomething == contactskill.mkskill__r.name, true, false)}">
or rendered="{!IF( NOT(ISBLANK(skill)) && skill == contactskill.mkskill__r.name, true, false)}">
Blind test.
For the test:
The trick used with <apex:facet> should work but there could be a difference of behavior for instance at the level of <apex:page> and its previous action.
contactskills = [Select id, mkskill__r.name, contact__r.name, contact__r.account.name, contact__r.email from Skill_Contact_Relationship__c where mkskill__r.name != null order by mkskill__r.name, contact__r.lastname];
Try the following request and post the result (that must be a number):
Select count(id)
from Skill_Contact_Relationship__c
where mkskill__r.name != nul
<apex:repeat value="{!skills}" var="skill"> : Seeing this even when the column is manually rendered false.
Select count(id)
from Skill_Contact_Relationship__c
where mkskill__r.name = nul
https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_null.htm
Please post the result (that must be also a number)
What do you see now?
You don't need
<apex:repeat>Sorry, I forgot to tell you about the current loops.
<apex:repeat value="{!skills}" var="skill"><apex:pageBlock
title="{!skill}"><apex:pageBlockSection columns="1" >
<apex:pageBlockTable align="center" border="3" value="{!contactskills}" var="contactskill"columnsWidth="200px, 200px, 400px">
<apex:column headerValue="Organization" rendered="{!IF(skill == contactskill.mkskill__r.name, true, false)}">
<apex:outputText value="name={!contactskill.mkskill__r.name}"></apex:outputText>
<!-- apex:outputLink style="text-decoration:none">DifferentContactNames</apex:outputLink -->
</apex:column>
</apex:pageBlockTable>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:repeat>You are using two loops and that is useless.
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_pageBlockTable.htm
I tried the code you provided. With what you provided, I no longer have the skills grouping visual display and I am still seeing blank rows. Below is my code & picture of the results.
You don't need:
<apex:repeat value="{!skills}" var="skill">(must be deleted)You are using two loops and only one loop is sufficient.
<apex:repeat value="{!skills}" var="skill"><apex:pageBlockTable align="center" border="3" value="{!contactskills}" var="contactskill"columnsWidth="200px">
... and the code in the apex class; must be rewritten entirely according to me.
All your apex code seems wrong. You can open a new question explaining your problem from the beginning (here and on other forums with your strange result with your code, there is not much chance that somebody else helps you but you can try https://salesforce.stackexchange.com/ you can get an answer that day).
If you don't have the extra blanks lines without the trick of the javascript function, remove it and that will work fine.
Regards
People are interested by strange results if they can see it directly in the question.
You wrote: "Below is the code I have that works but is slow loading." and there is the javascript call (?)
https://salesforce.stackexchange.com/questions/195787/salesforce-code-advice-for-displaying-records-in-a-grouped-by-format
No one will respond if you say that works yet.
This tricky solution is not stable for the loading of the initial page in your case.
We often use the loading message from a button on the loaded page but for the initial loading, the result seems not stable.
No one responds to your initial question on salesforce.stackexchange.com but you should put a question more simple: how to show a Loading message with an action="{!load}" even if you will get the "eltoro" solution probably again (but not sure).
All the standard pages in Lightning have a loading spinner right now (standard behavior) but that doesn't exist in Classic.
There is surely a reason (insufficient stability?)