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
raju.Braju.B 

How to render a output panel in action support

Hi,

 

I displayed all records of an object in visualforce page.

 

 

I kept commandlink for a column in VF page.

I wrote a action support on mouseover that means a panel will get displayed with the details of a record, when i place mouse on particular record.

 

I have tried but i was unable to get it.

 

Can any one help me out?

Thanks & Regards,

 

Raju.b

kiranmutturukiranmutturu

 

try this
<apex:page standardController="account" recordSetVar="accounts">
  
  <apex:form >
    
        <apex:pageBlock title="Account">
        
            <apex:pageblockSection title="List Of Accounts">
            
                <apex:pageBlockTable value="{!accounts}" var="acct" rows="5">
                
                
                    <apex:column headerValue="Account Names">
                    
                    {!acct.name}
                    
                    <apex:actionSupport event="onmouseover" status="act" reRender="op">
                    
                    <apex:param name="aid" value="{!acct.id}"/>
                    
                    </apex:actionSupport>
                    </apex:column>
                </apex:pageBlockTable>
            </apex:pageblockSection>
        </apex:pageBlock>
        <apex:actionStatus startText="Please Wait ...Loading.........." id="act"/>
        <apex:outputPanel id="op">
        <apex:detail subject="{!$CurrentPage.parameters.aid}" relatedList="true"/>
        </apex:outputPanel>
  </apex:form>    
  
</apex:page>

 

raju.Braju.B

Hi,

Thanks for the reply,

 

I need to put a button which closes that detail page panel by clicking on it.

 

Can u help me that??

please.

 

 

Thanks & Regards,

Raju.b

kiranmutturukiranmutturu

 

try this
<apex:page standardController="account" recordSetVar="accounts">
  <script>
  function HideSection(){
      var opid = document.getElementById('{!$component.op}');
      opid.style.display = 'none';
  }
  </script>
  <apex:form >
    
        <apex:pageBlock title="Account">
        
            <apex:pageblockSection title="List Of Accounts">
            
                <apex:pageBlockTable value="{!accounts}" var="acct" rows="5">
                
                
                    <apex:column headerValue="Account Names">
                    
                    {!acct.name}
                    
                    <apex:actionSupport event="onmouseover" status="act" reRender="op">
                    
                    <apex:param name="aid" value="{!acct.id}"/>
                    
                    </apex:actionSupport>
                    </apex:column>
                </apex:pageBlockTable>
            </apex:pageblockSection>
        </apex:pageBlock>
        <apex:actionStatus startText="Please Wait ...Loading.........." id="act"/>
        <apex:commandbutton id="hidebtn" value="Hide" onclick="HideSection()"/>
        <apex:outputPanel id="op">
        <apex:detail subject="{!$CurrentPage.parameters.aid}" relatedList="true"/>
        </apex:outputPanel>
  </apex:form>    
  
</apex:page>

 

raju.Braju.B

Hi,

 

Thanku very much for the code.

 

I have tried for my custom object but im unable to get it.

 

I will send u code can u help me out please.

 

Controller and page.

 

Thanks & Regards

raju.Braju.B

 

public class related11
{
public boolean showdetrecs{set;get;}
public boolean showeditrecs{set;get;}
message__c m1;
public string mee{set;get;}
String eid;
set<id> mset=new set<id>();
list<message__c> mlist=new list<message__c>();
list<message__c> rlist=new list<message__c>();
public boolean ree{set;get;}
public boolean re{set;get;}
public boolean re1{set;get;}
public  related11()
{
showdetrecs=true;
re=false;
re1=true;
for(message__c m:[select name,id from message__c])
{
mlist.add(m);
}
}
public void view()
{
eid=apexpages.currentPage().getParameters().get('pid');
m1=[select messg__c,id,name from message__c where id=:eid];
m1.messg__c='';
showeditrecs=true;
}
public list<message__c> getdata()
{
return rlist;
}
public list<message__c> getrdetails()
{
return mlist;
}
public message__c getcomment()
{
return m1;
}
public void save()
{
showeditrecs=false;
re=false;
update m1;
m1.messg__c='';
}
public void cancel()
{
m1.messg__c='';
showeditrecs=false;
}
}

 

public class related11{public boolean showdetrecs{set;get;}public boolean showeditrecs{set;get;}message__c m1;public string mee{set;get;}String eid;set<id> mset=new set<id>();list<message__c> mlist=new list<message__c>();list<message__c> rlist=new list<message__c>();public boolean ree{set;get;}public boolean re{set;get;}public boolean re1{set;get;}public  related11(){showdetrecs=true;re=false;re1=true;for(message__c m:[select name,id from message__c]){mlist.add(m);}}public void view(){eid=apexpages.currentPage().getParameters().get('pid');m1=[select messg__c,id,name from message__c where id=:eid];m1.messg__c='';showeditrecs=true;}public list<message__c> getdata(){return rlist;}public list<message__c> getrdetails(){return mlist;}public message__c getcomment(){return m1;}public void save(){showeditrecs=false;re=false;update m1;m1.messg__c='';}public void cancel(){m1.messg__c='';showeditrecs=false;}}

 

 

 

 

 

<apex:page controller="related11" showHeader="false">

<!--<script language="javascript" type="text/javascript">

 

       function toggleDiv()

 

       { 

 

           document.getElementById("Button1").style.visibility="hidden"; 

 

         } 

 

function toggleDiv1()

 

       { 

if(document.getElementById("Button1").style.visibility=="hidden")

{

           document.getElementById("Button1").style.visibility="visible"; 

           }

else

document.getElementById("Button1").style.visibility="hidden";

         } 

 

 

     </script>-->

<apex:form >

<apex:outputPanel rendered="{!showdetrecs}" id="aaa">

<apex:pageBlock onclick="toggleDiv()">

<apex:pageBlockTable value="{!rdetails}" var="t">

<apex:column headerValue="Name" >{!t.name}

 

 

 

<apex:actionSupport event="ondblclick"  action="{!view}" rerender="acctDetails"> 

                              <apex:param name="pid" value="{!t.Id}"/>

                          </apex:actionSupport>  

 

</apex:column>

</apex:pageBlockTable>

 

</apex:pageBlock>

</apex:outputPanel>

<div id="Button1">

<apex:outputPanel styleClass="customPopup" id="acctDetails" rendered="{!showeditrecs}">

 <!--<apex:pageBlock title="{!comment.name}" >-->

 

<!--<apex:pageblockSection title="Comment">-->

 

<apex:outputtext value="{!comment.messg__c}"/>

 

<!--</apex:pageBlockSection>-->

 

<center>

<!--<apex:commandButton value="Save" action="{!save}"/>-->

<apex:commandButton value="Cancel" action="{!cancel}" />

</center><!--</apex:pageBlock>-->

</apex:outputPanel>

</div>

<style type="text/css">

       .customPopup{

            background-color: white;

            border-style: solid;

            border-width: 4px;

            left: 40%;

            padding:10px;

            position: absolute;

            z-index: 9999;

            /* These are the 3 css properties you will need to tweak so the pop 

            up displays in the center of the screen. First set the width. Then set 

            margin-left to negative half of what the width is. You can also add 

            the height property for a fixed size pop up.*/

            width: 200px;

            margin-left: -250px;

            top:100px;

 

        }

 

    </style>

 

 

 

    </apex:form>

</apex:page>

 

Prafull G.Prafull G.

replace

<apex:outputPanel styleClass="customPopup" id="acctDetails" rendered="{!showeditrecs}">

with

<apex:outputPanel id="acctDetails">

<apex:outputPanel styleClass="customPopup" rendered="{!showeditrecs}">

<!--YOUR CODE HERE-->

</apex:outputPanel>

</apex:outputPanel>

 

what I did is to put the panel is seperate container i.e. another output panel and rerender the outer panel instead of inner.

 

check it out and let me know if it works for you.

 

Regards,

Prafull G.

PJayaPJaya

yeah it has been worked

 

but y we should keep inner tag i didn't get the logic