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 

Hi I need to display record details as a pop up menu

Hi,


I dispalyed all records of a custom object...

 when i click on a record it need to diplay that record details as a popup menu...

 

 

Can any one help me out please...???

 

 

Swetha.k

Chamil MadusankaChamil Madusanka

Hi Raju,

 

Use <apex:OutputLink> attribute with your page which contain all records. Use _balnk in target.

 

 

<apex:outputLink value="/{!CustomObject__c.id}" target="_blank">Add</apex:outputLink>

 If you need further clarification please post your code.

 

If a reply to a post answers your question or resolves your problem, please mark it as the solution to the post so that others may benefit.

--

Chamil Madusanka

 

raju.Braju.B

Hi,

thanks for the reply..

 

I will send u code...

 

 

raju.Braju.B

 


public class related11
{
//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()
{
re=false;
re1=true;
for(message__c m:[select name,id from message__c])
{
mlist.add(m);
}
}
public void view()
{
//rlist.clear();
ree=true;
//re1=false;
eid=apexpages.currentPage().getParameters().get('pid');
for(message__c m1:[select messg__c,id,name from message__c where id=:eid])
{
mee=m1.messg__c;
}
}
public list<message__c> getdata()
{
return rlist;
}
public list<message__c> getrdetails()
{
return mlist;
}
/*public void save()
{
re=false;
update m1;
}*/
}

<apex:page controller="related11">
<apex:form >
<apex:pageBlock >
<!--<apex:outputPanel rendered="{!re1}">-->
<apex:pageBlockTable value="{!rdetails}" var="item" id="detail1">
  <apex:column headerValue="name">
  <apex:commandLink value="{!item.name}" action="{!view}" >
 
                              
                          
                          <apex:param name="pid" value="{!item.id}"/>
                          </apex:commandLink>
                          
  
                          
                          
                          </apex:column>
 
  </apex:pageBlockTable>
  
 <apex:outputText value="{!mee}" />
  
</apex:pageBlock>
</apex:form>
</apex:page>

<apex:page controller="related11"><apex:form ><apex:pageBlock ><!--<apex:outputPanel rendered="{!re1}">--><apex:pageBlockTable value="{!rdetails}" var="item" id="detail1">
  <apex:column headerValue="name">  <apex:commandLink value="{!item.name}" action="{!view}" >                                                                                   <apex:param name="pid" value="{!item.id}"/>                          </apex:commandLink>                                                                                                          </apex:column>   </apex:pageBlockTable>   <apex:outputText value="{!mee}" />  </apex:pageBlock></apex:form></apex:page>

 

Chamil MadusankaChamil Madusanka

Hi,

 

 

public class related11
{
//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()
{
re=false;
re1=true;
for(message__c m:[select name,id from message__c])
{
mlist.add(m);
}
}
public void view()
{
//rlist.clear();
ree=true;
//re1=false;
eid=apexpages.currentPage().getParameters().get('pid');
for(message__c m1:[select messg__c,id,name from message__c where id=:eid])
{
mee=m1.messg__c;
}
}
public list<message__c> getdata()
{
return rlist;
}
public list<message__c> getrdetails()
{
return mlist;
}
/*public void save()
{
re=false;
update m1;
}*/
}

 

 

 

 

<apex:page controller="related11">
<apex:form >
<apex:pageBlock >
<!--<apex:outputPanel rendered="{!re1}">-->
<apex:pageBlockTable value="{!rdetails}" var="item" id="detail1">
  <apex:column headerValue="name">
 <!-- <apex:commandLink value="{!item.name}" action="{!view}" >
                    
      <apex:param name="pid" value="{!item.id}"/>
  </apex:commandLink> -->
<apex:outputLink value="/{!item.id}" target="_blank">Add</apex:outputLink>

 </apex:column> </apex:pageBlockTable> <apex:outputText value="{!mee}" /> </apex:pageBlock> </apex:form> </apex:page>

 

Replace the highlighted line for commandlink

 

Try it. If any issue reply.

 

If a reply to a post answers your question or resolves your problem, please mark it as the solution to the post so that others may benefit.

--

Chamil Madusanka

 

raju.Braju.B

Hi,

 

IT is working fine but..I need to display it as a popup menu..

 

Please help me......

Chamil MadusankaChamil Madusanka

Hi Raju,

 

Are you using firefox browser? Please try it with IE.

 

If a reply to a post answers your question or resolves your problem, please mark it as the solution to the post so that others may benefit.

--

Chamil Madusanka

 

raju.Braju.B

Hi,

 

It is working fine..

 

one more help please.

 

I need a to display only one filed value when i click on that partcular record as a popup.

 

Is it possible??

 

 

Chamil MadusankaChamil Madusanka

Hi Raju,

 

Then you need to create a visualforce page with field you need. Then set the value attribute of outputLink component with "/apex/yourpagename".

 

But If you want show only one field in th popup then It is better to show that field in the page with contain all recoreds. Because it is useless use a popoup for one field.

 

If a reply to a post answers your question or resolves your problem, please mark it as the solution to the post so that others may benefit.

--

Chamil Madusanka

raju.Braju.B

Hi,

thanks for the reply.

 

 

I don't want to display it as a window..I need it as a popup menu which dipslayes that filed value .That is my requirement.

 

I have tried a lot but i didn't get..

 

Is there any way??

Chamil MadusankaChamil Madusanka

Hi Raju,

 

Yes, I got your requirement. There is a way to fulfill your requirement.

 

 

<apex:page controller="related11">

<apex:styleSheet value="http://yui.yahooapis.com/2.6.0/build/assets/skins/sam/skin.css" />
 
<apex:includeScript value="http://yui.yahooapis.com/2.6.0/build/yahoo-dom-event/yahoo-dom-event.js" />
<apex:includeScript value="http://yui.yahooapis.com/2.6.0/build/container/container-min.js" />
<apex:includeScript value="http://yui.yahooapis.com/2.6.0/build/animation/animation-min.js" />
 
<script>
    
    // Create a namespace for our custom functions
    YAHOO.namespace("force.com");

    // Function called when we want to show the dialog
    YAHOO.force.com.showMe = function() {
        document.getElementById("myPanel").style.display = "block";
        YAHOO.force.com.myDialog.show();
    }
   
    // Function called when we want to hide the dialog
    YAHOO.force.com.hideMe = function() {
        YAHOO.force.com.myDialog.hide();
    }

    // Function called when the DOM is ready to create the dialog,
    // render the dialog into the document body, add our dialog skin
    // css to the body tag, and wire up the buttons on our dialog    
    YAHOO.force.com.init = function() {
        document.body.className = document.body.className + " yui-skin-sam";
        
        YAHOO.force.com.myDialog = new YAHOO.widget.Panel(
            "myPanel",  // The id of our dialog container
            { 
                    width           :   400,    // You can play with this until it's right
                    visible         :   false,  // Should be invisible when rendered
                    draggable       :   true,   // Make the dialog draggable
                    close           :   true,  // Don't include a close title button
                    modal           :   true,   // Make it modal
                    fixedCenter     :   false,   // Keep centered if window is scrolled
                    zindex          :   40,     // Make sure it's on top of everything
                    
                    // This line adds the appear/vanish fade effect
                    effect          :   {
                                          effect:YAHOO.widget.ContainerEffect.FADE,
                                          duration:0.35
                                        } 
            }
         );
        
        // Render the dialog to the document.body level of the DOM
        YAHOO.force.com.myDialog.render(document.body);
    }
    
    // Add the init method to the window.load event
    YAHOO.util.Event.addListener(window, "load", YAHOO.force.com.init);
</script>

<apex:form >
<apex:pageBlock >
<!--<apex:outputPanel rendered="{!re1}">-->
<apex:pageBlockTable value="{!rdetails}" var="item" id="detail1">
  <apex:column headerValue="name">
      <apex:commandLink value="{!item.name}" action="{!view}" onclick="YAHOO.force.com.showMe();">
          <apex:param name="pid" value="{!item.id}"/>
      </apex:commandLink>
  </apex:column>
 
  </apex:pageBlockTable>
  
 <apex:outputText value="{!mee}" />
  
</apex:pageBlock>
</apex:form>

<!-- This is the content of the modal dialog -->
<div id="myPanel" style="display: none" >
  <div class="hd">
    <apex:outputText value="Cool Modal Dialog" />
  </div> 
  <div class="bd">
      <apex:form >
        <apex:pageBlock >
          <apex:pageBlockSection columns="1">
            <apex:inputField id="fName" value="{!account.name}" />
          </apex:pageBlockSection>
        </apex:pageBlock>
        <div style="text-align: right;" >
          <apex:commandButton value="Select" 
              oncomplete="YAHOO.force.com.hideMe();" />
          <apex:commandButton value="Cancel" immediate="true" 
              oncomplete="YAHOO.force.com.hideMe();"/>
        </div>
      </apex:form>
  </div>
  
</div>
</apex:page>

 

 

Here I have used YUI with salesforce. For further details refer

 

http://wiki.developerforce.com/index.php/Visualforce_Popup

 

If a reply to a post answers your question or resolves your problem, please mark it as the solution to the post so that others may benefit.

--

Chamil Madusanka