You need to sign in to do that
Don't have an account?
Srinath Teram
How to fetch a particular record inside <apex:repeat> ?
Hi,
I have a visualforce page where I displays some records inside<apex:commandLink> within <apex:repeat> iterating over a list in the controller. When I click on any of the records listed out it should display a pop up with details of the selected record. Anyone please suggest me how to acieve this?
VF Page:
<apex:outputPanel id="feedbackResponse"> <apex:outputPanel styleClass="customPopup" layout="block" rendered="{!seeAllWebinarsFlag}"> <apex:repeat value="{!webinars}" var="w"> <apex:commandLink onclick="seewebinardetails();return false;">{!w.Title__c} </apex:commandLink> <br/> </apex:repeat><br/> </apex:outputPanel></apex:outputPanel>
Controller:
onlineSocials = [Select Id, Title__c from Online_Social__c];
for(Online_Social__c os: onlineSocials) {
webinars.add(os);
}
Popup section:
<apex:repeat value="{!webinars}" var="w"> <apex:outputField value="{!w.Title__c}"/> <br/> </apex:repeat><br/>
seewebinardetails function:
function seewebinardetails() { webinar(); }
<apex:actionFunction name="webinar" action="{!seeWebinarDetails}" reRender="feedbackResponse, WebinarDetails"/>
Since I am new here had to struggle lot to pickup this:
VF page:
<apex:repeat value="{!world}" var="w">
<apex:commandLink value="{!w.Title__c}" action="{!dosomething}" reRender="renderthispanel">
<apex:param name="param1" value="{!w.id}" assignTo="{!onlineid}"/>
</apex:commandLink> <br/>
</apex:repeat>
Controller:
public string onlineid{get; set;}
public void dosomething() {
//manipulate with onlineid here
System.debug('##"+onlineid);
}
All Answers
There is a way to implement Salesforce standard hover functionality in visualforce page. Refer : http://salesforceworld.blogspot.com/2011/08/displaying-pop-up-summaries-on-hover-in.html
You can use this approach to accomplish your requirement without wrting additional apex code for popup content.
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.
Thanks Chamil for the reply. However, I need to display the details as a popup on a click from the record. I do not need a hover. I have another output panel which should be be rendered to display as a pop up? Thoughts please?
Since I am new here had to struggle lot to pickup this:
VF page:
<apex:repeat value="{!world}" var="w">
<apex:commandLink value="{!w.Title__c}" action="{!dosomething}" reRender="renderthispanel">
<apex:param name="param1" value="{!w.id}" assignTo="{!onlineid}"/>
</apex:commandLink> <br/>
</apex:repeat>
Controller:
public string onlineid{get; set;}
public void dosomething() {
//manipulate with onlineid here
System.debug('##"+onlineid);
}