You need to sign in to do that
Don't have an account?
Saie Shendage 7
In this table, I am displaying Society object in a table, where when I click on Location field I get directed to new page(maps.google.com) showing location on the map.
Instead of that, I want location to be displayed on the same page on mouseover.
Can you please help me out by providing the code?
How to display location field on google maps on mouseover?
<apex:page controller="Page2_Controller"> <apex:pageBlock > <apex:pageBlockSection > <apex:pageBlockTable value="{!Societies}" var="s"> <apex:column value="{!s.name}"/> <apex:column value="{!s.Secretary__c}"/> <apex:column value="{!s.No_of_Members__c}"/> <apex:column > <apex:facet name="header">Location</apex:facet> <apex:outputLink value="https://maps.google.com" target="new"> <apex:outputText value="{!s.Location__c}"/> <apex:param name="q" value="{!s.Location__c}"/> </apex:outputLink> </apex:column> </apex:pageBlockTable> </apex:pageBlockSection> </apex:pageBlock> <apex:form > <apex:inputHidden value="{!startingFrom}"/> <apex:panelGrid columns="2" cellpadding="2px"> <apex:commandLink action="{!previous}" value="Previous"/> <apex:commandLink action="{!next}" value="Next"/> </apex:panelGrid> </apex:form> </apex:page>
public class Page2_Controller { private final integer MAX_RECORDS_PER_PAGE = 5; public integer startingFrom {get; set;} private integer socRecordCount; //View Society public Page2_Controller(){ if(startingFrom == NUll) startingFrom=0; socRecordCount = [select count() from Society__c]; } public List<Society__c> getSocieties(){ List<Society__c> results=[select name,Secretary__c,No_Of_Members__c,location__c from Society__c limit :MAX_RECORDS_PER_PAGE offset : startingFrom]; return results; } public PageReference previous() { if(startingFrom <= 0) { startingFrom = 0; } else if(startingFrom >= socRecordCount) startingFrom = startingFrom - MAX_RECORDS_PER_PAGE; else if(startingFrom < socRecordCount) { startingFrom = startingFrom - MAX_RECORDS_PER_PAGE; } return ApexPages.currentPage(); } public PageReference next() { if((socRecordCount - startingFrom) > MAX_RECORDS_PER_PAGE) startingFrom = startingFrom + MAX_RECORDS_PER_PAGE; return ApexPages.currentPage(); } }
In this table, I am displaying Society object in a table, where when I click on Location field I get directed to new page(maps.google.com) showing location on the map.
Instead of that, I want location to be displayed on the same page on mouseover.
Can you please help me out by providing the code?
You need to use Google Maps API in your VF page, I suggest looking at this post
Let me know if this helps, if it does, please mark this answer as best so that others facing the same issue will find this information useful. Thank you