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
SharathChandraSharathChandra 

Help Me2

<apex:page controller="Display">
<apex:form>
<apex:pageBlock>
<apex:commandLink value="Test" action="{!showText}" reRender="pb1"/>
</apex:pageBlock>

<apex:pageBlock id="pb1" rendered="{!show}">
<apex:outputText >sharath
</apex:outputText>
</apex:pageBlock>

</apex:form>
</apex:page>

-----------

Controller

public class Display {

    public Boolean show { get; set; }

    public PageReference showText() {
    show=true;
        return null;
    }

}

 

i want to rerendered output text  by rerender the page block pb1

help me asap.

Best Answer chosen by Admin (Salesforce Developers) 
bob_buzzardbob_buzzard

Simple answer is you can't - if something isn't there you can't rerender it.  Thus you need some kind of outer container.  You can stick an outputpanel round the pageblock and rerender that can't you?

All Answers

bob_buzzardbob_buzzard

I've written a blog post on this, as I've hit it many times:

 

http://bobbuzzard.blogspot.co.uk/2011/02/visualforce-re-rendering-woes.html

SharathChandraSharathChandra

But Bob i want to use page block it self.

bob_buzzardbob_buzzard

Simple answer is you can't - if something isn't there you can't rerender it.  Thus you need some kind of outer container.  You can stick an outputpanel round the pageblock and rerender that can't you?

This was selected as the best answer
SharathChandraSharathChandra

Thanks alot blob