public with sharing class PopupTest {
public List getAccounts() {
List accounttList = new List();
accounttList = [Select Id, Name from Account LIMIT 10]; return accounttList ;
}
}
public class accountList{ public list<account> listAccount{get;set;} public list<contact> listContact{get; set;} public list<account> accountDetail{get;set;}
public pagereference list1() { listAccount = [select name,phone from account limit 10]; listContact = [select name from contact limit 10]; return null; }
public void fetchAccount(string id1) { system.debug('id1' + id1); accountDetail = [select name,phone from account where name=:id1];
public with sharing class PopupTest {
public List getAccounts() {
List accounttList = new List();
accounttList = [Select Id, Name from Account LIMIT 10]; return accounttList ;
}
}
Thanks Vasani Parth. when i put cursor on name then display all details in other given section. Is it possible? and i m new in jquery with salesforce so how to learn jquery related salesforce any good source?
You can try below example,
Visualforce page Controller
Please mark this as the best answer if this helps
All Answers
<apex:page controller="accountList">
<apex:includeScript value="{!URLFOR($Resource.Jquery, '/js/jquery-1.7.2.min.js')}" />
<script>
j$ = jQuery.noConflict();
j$(document).ready(function() {
j$("#givenAccount a").hover(function(){
var xyz = j$('id$=select1').val();
accountList.fetchAccount(xyz);
j$(.showAccountDetail).show();
});
});
</script>
<body>
<apex:form >
<apex:commandButton value="List" action="{!list1}"/>
<apex:pageBlock >
<apex:pageBlockSection >
<div id = "givenAccount">
<apex:pageblocktable value="{!listaccount}" var="a1" >
<apex:column> <a id="select1" href = "#">{!a1.name}</a> </apex:column>
</apex:pageblocktable>
</div>
<div class="showAccountDetail">
<apex:pageblocktable value="{!accountDetail}" var="a" >
<apex:column value="{!a.name}"/>
<apex:column value="{!a.phone}"/>
</apex:pageblocktable>
</div>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</body>
</apex:page>
apex
public class accountList{
public list<account> listAccount{get;set;}
public list<contact> listContact{get; set;}
public list<account> accountDetail{get;set;}
public pagereference list1()
{
listAccount = [select name,phone from account limit 10];
listContact = [select name from contact limit 10];
return null;
}
public void fetchAccount(string id1)
{
system.debug('id1' + id1);
accountDetail = [select name,phone from account where name=:id1];
}
}
You can try below example,
Visualforce page Controller
Please mark this as the best answer if this helps