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
kkaalkkaal 

Not wanted full page refresh

Can you tell me why, when I click the Edit or Save Link, it refreshes the entire side (including SFDC header and sidebar, if sidebar is not visible, it shows it and then disappears))

 

<apex:page Controller="NexTestController" standardStylesheets="true"> <apex:pageBlock title="Test {!selectedId}" id="listblock"> <apex:form > <apex:panelGroup id="mypanel"> <table with="100%"> <apex:repeat value="{!Relationships}" var="relation"> <apex:panelGroup rendered="{!or(selectedId != relation.Id,selectedId==null)}" style="border-bottom: 1px solid grey"> <tr> <td><apex:outputText value="{!relation.Id}" style="padding:4px" /></td> <td><apex:outputText value="{!relation.Analysis_Period__c}" style="padding:4px" /></td> <td><apex:outputText value="{!relation.Relationship_Code__c}" style="padding:4px" /></td> <td><apex:outputText value="{!SelectedId}" style="padding:4px" /></td> <td><apex:commandLink value="Edit" action="{!edit}" onmousedown="setEditorToLine('{!relation.Id}')" id="editbutton" rerender="mypanel"/></td> </tr> </apex:panelGroup> <apex:panelGroup rendered="{!selectedId == relation.Id}" style="border-bottom:1px solid #DADADA"> <tr> <td><apex:inputField value="{!relation.Id}" style="padding:4px" /></td> <td><apex:inputField value="{!relation.Analysis_Perios__c}" style="padding:4px" /></td> <td><apex:inputField value="{!relation.Relationship_Code__c}" style="padding:4px" /></td> <td><apex:inputField value="{!relation.Contact__c}" style="padding:4px" /></td> <td><apex:commandLink value="Save" action="{!save}" onmousedown="setEditorToLine('{!relation.Id}')" id="savebutton" rerender="mypanel" /></td> </tr> </apex:panelGroup> </apex:repeat> </table> </apex:panelGroup> <apex:actionFunction action="{!edit}" name="setEditorToLine"> <apex:param name="firstParam" assignTo="{!selectedId}" value="" /> </apex:actionFunction> </apex:form> </apex:pageBlock></apex:page>

 In my mind it should only refresh "mypanel"

 

 

 

 

Best Answer chosen by Admin (Salesforce Developers) 
kkaalkkaal

Thanks, that helped, I used that ActionRegion tag with the rederRegionOnly tag.

 

Thanks 

All Answers

ckumckum

Try to use outputPanel instead of PanelGroup. I hope it works, and if this still wont work then please send you controller also.

 

 

Thanks,

ckum

kkaalkkaal

Sorry, ckum, that did not work out.

 

Here is my controller: 

 

 

public with sharing class NexTestController { private final Account account; private final List<Relationship__c> relationships; public String selectedId {get; set;} public NexTestController(){ account = [select id, PersonContactId, name, site from Account where id = :ApexPages.currentPage().getParameters().get('id')]; relationships = [select Analysis_Period__c, Relationship_Code__c, Contact__r.Id, Contact__r.Name, Contact__r.LastName, Analysis_Perios__c from Relationship__c where Contact2__r.Id = :account.PersonContactId]; selectedId = 'MyTest'; } public Account getAccount(){ return account; } public List<Relationship__c> getRelationships(){ return relationships; } public PageReference edit(){ return null; } public PageReference save(){ return null; } }

 

 

 

JimRaeJimRae
Look at the ActionRegion tag, it allows you to specify a certain area of the form to rerender, instead of a full page refresh.
kkaalkkaal

Thanks, that helped, I used that ActionRegion tag with the rederRegionOnly tag.

 

Thanks 

This was selected as the best answer
kkaalkkaal

Sorry, I was too quick.

 

In 1 out of approx. 10 klicks on the link, it flashes up the sidebar, which quickly disappears again. 

 

And: The entire page turns to white and builds up again. That is not the right behaviour, right? 

JimRaeJimRae
I don't believe so. Have you tested with different browsers (FF, IE, etc), to see if the behavior is consistent?
kkaalkkaal

VERY inkonsistent!

 

 

  • FF flashes the entire page and - as I said - occasionally flashes the sidebar 
  • IE does not flash the entire page at all but occasionally flashes sidebar
  • Opera behaves like FF
  • Chrome is very stable. Seems to be ok
  • Safari is very stable. Seems to be ok
 
So where does me leave this? Any thoughts about a work around? 

 

 

 

JimRaeJimRae

Try to rework your page so it loads faster, or at least so you are rendering and rerending a smaller area?

Other than that, log a support call and see what SFDC support tells you.