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
Vivek ManchandaVivek Manchanda 

Why we have to give value on "reRender" on any command button or link ?

Hi

I have made a page in Visual Force where I am calling all the information from Account using a Custom controler

Now I have also made a button to Edit all the Fields,by clicking on that button I am showing all the fields in edit mode ,but when ever I click on  button the page get refresh and i cant see all the fields in edit mode . but when I used rerender in command button it work's .

Now the Problem is:-

Why I have to use Rerender ?

While using Rerender the code which I have Used are
<apex:commandLink id="chkbox" onclick="Hidediv()" rerender="detail" value="(Edit)"/>
where in  Rerender I have used "Detail" which does not present any where in my Application .

So the Thing is Why I have to use this Rerender ?

Thanks

Vivek Manchanda 
dchasmandchasman
Vivek,

I think you really want to use apex:outputLink instead of apex:commandLink - apex:commandLink is meant to be used to bind to an action method in your controller. Also, take a look at the docs for using rerender and partial page/ajax functionality - I typically recommend getting things working without partial page (rerender) first.

dchasmandchasman
Vivek,

You mentioned that you are using a custom controller to get an account object - have you considered just leveraging the standard controller (e.g. <apex:page standardController="Account"> with an extension perhaps)? The standard controller can handle many situations automatically - e.g. generates SOQL queries including joins to related objects based on what you reference in your page, respects sharing/field level security, and much more. For situations where what it provides out-of-the-box is not enough it is trivial to mix in your own code - even override the standard controller's methods and properties - using an apex code based extension...