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
Ritesh__Ritesh__ 

reRender and rendered attribute in visualforce

i write a visualforce page with source code

<apex:page controller="MyController1">
<apex:form>
<apex:pageBlock >
<apex:pageBlockSection  id="search">
<apex:commandLink action="{!commandLinkAction}" value="Advance Search"  reRender="thePanel" id="theCommandLink"/>
<apex:outputPanel id="thePanelWrapper">
<apex:outputPanel id="thePanel" rendered="{! rend}" layout="block">My div</apex:outputPanel>
</apex:outputPanel>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

and the MyController1 class is

public class MyController1{
public Boolean rend{get;set;}
public PageReference commandLinkAction(){
rend=true;
return null;
}

}

when i click on Advanced Search link nothing happens but i was expecting outputPanel with id "thePanel" should render.why it is not rendering please someone explain??

Chamil MadusankaChamil Madusanka

I changed your code. check the code and see, are there your requirement?

 

<apex:page controller="MyController1">
<apex:form >
<apex:pageBlock >
<apex:pageBlockSection id="search">
<apex:commandLink action="{!commandLinkAction}" value="Advance Search"  reRender="thePanelWrapper" id="theCommandLink"/>
<apex:outputPanel id="thePanelWrapper">
<apex:pageBlock id="thePanel" rendered="{! rend}" ></apex:pageBlock>
</apex:outputPanel>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

 

public with sharing class MyController1 {
public Boolean rend { get; set; }
public MyController1 ()
{
rend = false;
}

    

    public PageReference commandLinkAction() {
    rend = true;
        return null;
    }

}

 If you got the answer from this post, Please hit the Kudos button & mark the answer as solution, It might help others running to into similar problem in future.

reatlimecoreatlimeco
Change the rerender to this id instead:

thePanelWrapper

rerender should always be to an outputpanel with NO rendered on it
Sajal Bansal 26Sajal Bansal 26
BEST ANSWER
Sajal Bansal 26Sajal Bansal 26
i want to match email and password from database and display that email detail how i achive this