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
Kamakshi SharmaKamakshi Sharma 

why we use two outputPanel one for giving id and second for rendered, like this one in the below example, what will happen if I use id and rendered in same outputPanel, I know there will be some problem if we'll use id and rendered in same outputPanel

<apex:outputPanel id="accdetails">
       <apex:outputPanel rendered="{!selectAcc.id !=Null}">
           <table><tr>
               <td>Name : {!selectAcc.Name}</td>
               <td>Id : {!selectAcc.Id}</td>
              </tr>
               <tr>
               <td>Owner : {!selectAcc.Ownerid}</td>
               <td>Rating : {!selectAcc.Rating}</td>
               </tr>
           </table>
        </apex:outputPanel>
       </apex:outputPanel>
@Amit Kumar Giri@Amit Kumar Giri
There are nothing such standard outlined best practice to use 2 panel. Also there will be no problem using id and rendered in one panel . Its all depends on the code and the output. Sometime if there are multiple inner panel needed and all of them need not to be rendered always then u need a parent panel with an ID and a sub pannel to rendered based on different criteria so that respective panel do rendered.  

For example below.
1. Account apart from "Govt" industry can only be displayed
2. If Account haveing rating , then first panel will show up
3. If Account source is FB then 2nd panel will show up.

Imagine this kind of a task. here u need a parent panel and 2 sub panel and there will be no issue using id along with rendered either in parent panel or sub panel.
<apex:page standardController="Account" sidebar="false">
    <apex:pageBlock >
      <apex:outputPanel id="accdetails" rendered="{!Account.Industry !='Government'}">
           <apex:outputLabel value="Panel 1" style="color : red"/>
           <apex:outputPanel id="pnl1" rendered="{!Account.Rating !=Null}">
               <table>
                   <tr>
                       <td>
                           Name : {!Account.Name}
                       </td>   
                   </tr>
                   <tr> 
                       <td>
                           Industry : {!Account.Industry}
                       </td>              
                   </tr> 
                   <tr>   
                       <td>
                           Rating : {!Account.Rating}
                       </td>     
                   </tr>
                   <tr>
                       <td>
                           Owner : {!Account.Owner.FirstName}
                       </td>                  
                   </tr>
               </table>
            </apex:outputPanel><br></br>
            <apex:outputLabel value="Panel 2" style="color : red"/>
            <apex:outputPanel id="pnl2" rendered="{!Account.AccountSource =='FaceBook'}">
               <table>
                   <tr>
                       <td>
                           Name : {!Account.Name}
                       </td>   
                   </tr>
                   <tr> 
                       <td>
                           Industry : {!Account.Industry}
                       </td>              
                   </tr> 
                   <tr>   
                       <td>
                           Account Source : {!Account.AccountSource}
                       </td>     
                   </tr>
                   <tr>
                       <td>
                           Owner : {!Account.Owner.FirstName}
                       </td>                  
                   </tr>
               </table>
            </apex:outputPanel>
       </apex:outputPanel>
   </apex:pageBlock>
</apex:page>
User-added image