+ Start a Discussion
nishad basha 7nishad basha 7 

<apex:pageBlock rendered="{!IF(validIT==false, false, true)}">. ........why we are using this tag in visualforce page?

what is the use of above tag. please give some ideas.
Vivek DeshmaneVivek Deshmane
HI Nashad,
apex:pageBlock

Is An area of a page that uses styling similar to the appearance of a Salesforce detail page, but without any default content.

This component supports HTML pass-through attributes using the "html-" prefix. Pass-through attributes are attached to the generated container <div> tag. and we can render this block contents conditonally using render atrribute of this tag

This tag is require when your planning to use <apex:pageBlockTable>


<apex:page standardController="Account">
    <apex:form>
        <apex:pageBlock title="My Content" mode="edit">
            <apex:pageBlockButtons>
                <apex:commandButton action="{!save}" value="Save"/>
            </apex:pageBlockButtons>
            <apex:pageBlockSection title="My Content Section" columns="2">
                <apex:inputField value="{!account.name}"/>
                <apex:inputField value="{!account.site}"/>
                <apex:inputField value="{!account.type}"/>
                <apex:inputField value="{!account.accountNumber}"/>
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>

Please let me know if this helps you.
Best Regards,
-Vivek
nishad basha 7nishad basha 7
Hi, Vivek Deshmane   
How to display the Account number in visualforce page?


  I have one SBI Account Number like : Based On Account number how to search the account  details in visualforce page?
Prosenjit Sarkar 7Prosenjit Sarkar 7
Hi nishad,
If you are using standard controller then you can show your account number using this,
<apex:inputField value="{!Account.AccountNumber}" />

but still cannot get your requirement clearly.

Thanks
Prosenijit
Vivek DeshmaneVivek Deshmane
Hi Nishad,
Please try below code .

Visualforce Pge
<apex:page standardController="Account" extensions="AccountExt">
<apex:form>
<apex:pageBlock id="pbSearchId">
<apex:inputField value="{AccountRecord.AccountNumber}">

<apex:commandbuttion value="Search" Action={!SearchAccount} Render="PbId,table"/>
</apex:pageBlock>
<apex:pageBlock id="PbId" rendered="{!AND(!ISNULL(lstAccounts))}">

<apex:pageBlockTable id="table" var="accvar" value="{!lstAccounts}" rendered="{!AND(!ISNULL(lstAccounts))}">
<apex:column headerValue="Name">
      <apex:outputField value="{accvar.Name}"/>                                
  </apex:column>
   <apex:column headerValue="AccountNumber">
      <apex:outputField value="{accvar.AccountNumber}"/>                                
  </apex:column>
 </apex:pageBlockTable >
</apex:pageBlock>
</apex:form>
</apex:page>

Controller

public AccountExt
{
    public Account AccountRecord{get;set;}
    public List<Account> lstAccounts{get;set;}
    
    public AccountExt(ApexPages.StandardController controller)
    {
        
        AccountRecord= new Account();
    }
        
    public void SearchAccount()
    {
        if(AccountRecord!=null && String.isNotEmpty(AccountRecord.AccountNumber))
        {
         lstAccounts=[SELECT Name,AccountSource,BillingAddress,AccountNumber FROM Account WHERE AccountNumber =:AccountRecord.AccountNumber]
        }
        
    }
    
}

Please let me know if it helps you.
Best Regards,
-Vivek