+ Start a Discussion
SFineSFine 

Differences between Chrome and Firefox

Hello,

 

My organization is making a unique VF page for Accounts which involves the use of radio buttons that update the page. The problem isn't so much getting the buttons to work at all, but for some reason the buttons don't work on Chrome while they work fine on firefox. Is there a particular reason this is the case? Is there some way to make is so the radio buttons work for chrome as well?

 

Thanks in advanced and I eagerly await a reply.

hitzhitz

Hi,

 

u have written any javascript code for it. if yes  then please check javascript code i think its javascript error

SFineSFine

The most Javascript it uses is the script that is native to salesforce such as rerendering a pageblock

Pradeep_NavatarPradeep_Navatar

Can you publish your code here?

SFineSFine

 

<apex:page standardController="Account" showHeader="true" tabStyle="account" 
extensions="AccountDetailController" action="{!if(account.recordtypeid == '01230000000ztsrAAA', 
    null, 
    urlFor($Action.Account.View, account.id,
    null, true))}">
     <apex:stylesheet value="{!URLFOR($Resource.jquery_treeTable_css)}" />
       <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.12/themes/base/jquery-ui.css" media="handheld,print,projection,screen,tty,tv" rel="stylesheet" type="text/css" />
      <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
      <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.12/jquery-ui.min.js"></script>
      <script type="text/javascript" src="{!URLFOR($Resource.jquery_treeTable_min_js)}"></script>
      <script type="text/javascript">
       var j$ = jQuery.noConflict();
            var treeParent;
            var acctTreehHtml;  
                
      j$(document).ready(function(){
       j$("a:contains('[View Hierarchy]')").hide();
       
      });
      
      
 
  
      var reloadText= function(id){
       j$('#'+id).text('reloading...');
      }
      
      function showDialog(){

        acctTreehHtml=j$("#06630000000d4u2").contents().find("body").html();
           //treeParent=j$("#06630000000d4u2").parent().parent();
        var myPopup = j$("#myDialog");
        myPopup.html(acctTreehHtml);
        
        myPopup.find("#hierarchy-popup-link").hide();
            
            myPopup.dialog({
                modal: true,height: 700,width: 1000,minWidth: 800
            });
                   
      }
      
      </script>
      <style type="text/css">
       /*.relatedlist-selects{
        width: 500px !important;
        float: right;
       }*/
       .pbTitle-custom{
        width: 100% !important;
       }
       .relatedlist-buttons{
        position: relative;
       }
       .title-custom{
        display: inline !important;
       }
       .spaceAlign {
        padding-right:200px;
       }

       .custom-filters{
        background-color: #F4EAE3;
        float: right;
        left: -24px;
        padding-bottom: 4px;
        position: relative;
        width: 400px;
        *margin-top: -25px;
       }
       .custom-filters h4 {      
        display: block;
        float: left;
        width: 155px;
        margin-left: 5px;
       }
       
       .custom-filters td{
        width: 200px;
       }
       .bPageBlock .list {
        margin-top: 20px;
        *margin-top: 40px;
       }
       .custom-filter-group{
        padding-top: 2px;
        *padding-top: 0;
        /*border: 1px solid black;*/
       }
       .custom-filter-limit{
        /*border: 1px solid black;*/
       }            
      
      </style>
 <!--  <a href="#popup-link" id="popup-link">Pop-up hierarchy</a>-->
      <chatter:feedWithFollowers id="AccountFeed" entityId="{!account.id}" />  
      <apex:form id="form1">
        <div class="listHoverLinks" style="visibility: visible;">
        <a href="#Opp">Opportunities</a> <span class="pipe"> | </span>
        <a href="#Contact">Contacts</a> <span class="pipe"> | </span>
        <a href="#AccRes">Account Resources</a> <span class="pipe"> | </span>
        <a href="#Cas">Cases</a> <span class="pipe"> | </span>
        <a href="#Ass">Assets</a> <span class="pipe"> | </span>
        <a href="#Contract">Contracts</a> <span class="pipe"> | </span>
        <a href="#OpAct">Open Activities</a> <span class="pipe"> | </span>
        <a href="#ActHist">Activity History</a> <span class="pipe"> | </span>
        <a href="#Finan">Financial Improvements</a> <span class="pipe"> | </span>
        <a href="#Imp">Implementation Projects</a> <span class="pipe"> | </span>
        <a href="#Note">Notes &#38; Attachments</a> <span class="pipe"> | </span>
        <a href="#accHist">Account History</a> <span class="pipe"> | </span>
        <a href="#lead">Associated Leads</a>
        </div>
        
        <c:vf_relatedlist_hovers />
            
      <apex:panelGroup > 
      <div id="Ass"/>            
      <apex:pageBlock title="Assets"  dir="{!account.Name}" id="AssetsBlock">
      <apex:facet name="header">
      <apex:form id="form3">     
          <apex:outputPanel styleClass="pbTitle pbTitle-custom" layout="block"> 
            <h2 class="title-custom"><span class="spaceAlign">Assets</span></h2>
            <apex:commandButton styleClass="relatedlist-buttons" action="/02i/e?retURL=%2Fapex%2FAccountDetail%3Fid%3D{!account.id}%26sfdc.override%3D1&accid={!account.id}" value="New Asset"/>             
            <div class="custom-filters">
             <div class="custom-filter-group custom-filter-limit">
              <h4>Filters:</h4> 
              <apex:outputText value="Show All" style="Display:{!if(Asset5,'','none')}"/><apex:inputCheckbox value="{!assetShowAll}" style="Display:{!if(Asset5,'','none')}"> <apex:actionSupport event="onclick" reRender="AssetsBlock" status="status" action="{!queryAssets}" onsubmit="reloadText('assBlock');"/> </apex:inputCheckBox> <apex:outputText value="Showing 5 of {!AssetTotal}" style="Display:{!if(!AssetShowAll && Asset5,'','none')}"/>                 
              <span id="assBlock"></span>
             </div>
             <div class="custom-filter-group">             
              <apex:selectRadio id="radiofield" layout="lineDirection"  value="{!assetQueryType}" styleClass="relatedlist-selects">
                <apex:actionSupport event="onclick" reRender="AssetsBlock" status="status" action="{!queryAssets}" onsubmit="reloadText('assBlock');"/>
                <apex:selectOptions value="{!AssetQueryTypes}"/>
              </apex:selectRadio> 
            </div>
           </div>
        </apex:outputPanel>      
      </apex:form>                     
      </apex:facet>    
        <apex:pageblocktable value="{!Assets_list}" var="Asset" styleClass="list headerRow" rowClasses="odd,even">    
         
         <!--<apex:column >
            <a href="/{!Asset.Asset.id}"><apex:outputField value="{!Asset.Asset.name}"/></a>
            <apex:facet name="header">Asset Name</apex:facet>
         </apex:column>-->
         <apex:repeat value="{!$ObjectType.Asset.FieldSets.AccAssetLayout}" var="LFS">   
                
                <apex:column value="{!Asset.Asset[LFS]}" rendered="{!if(LFS=='Name','false','true')}"/>
               
                <apex:column style="display:{!if(LFS=='Name','','none')}" rendered="{!if(LFS=='Name','true','false')}">
                     <a href="/{!Asset.Asset.id}"><apex:outputfield value="{!Asset.Asset[LFS]}" /></a>
                     <apex:facet name="header">{!LFS}</apex:facet>
                </apex:column>
                
            </apex:repeat>
         
        </apex:pageblocktable>                  
        </apex:pageBlock>
      </apex:panelGroup>
     
</apex:page>

 Here's a sample bit of code. Let here's the controller if you want to see:

 

public  class AccountDetailController {
 private Account acct;      
 public List<ContactWrapper> contacts_list  {get; set;} 
 public List<AssetWrapper> Assets_list  {get; set;} 
 public List<OpportunityWrapper> opportunities_list  {get; set;}
 public List<ContractWrapper> contracts_list  {get; set;} 
 public List<CaseWrapper> cases_list  {get; set;} 
 public List<AccountResourceWrapper> accountResource_list  {get; set;} 
 public List<Lead> AsLeadlist  {get; set;}
 public List<ImplementWrapper> implements_list  {get; set;}
 public list<AccHistWrapper> AccHist{get; set;}
 public list<AccountHistory> AHlist{get; set;}
 
 public String contactQueryType  {get; set;}  
 public String contactQueryType2  {get; set;}
 public String AssetQueryType  {get; set;}  
 public String opportunityQueryType  {get; set;} 
 public String opportunityQueryType2  {get; set;}   
 public String contractQueryType  {get; set;}  
 public String caseQueryType  {get; set;}   
 public String caseQueryType2  {get; set;}  
 public String accountResourceQueryType  {get; set;}  
 public String implementQueryType  {get; set;}  
 public String implementQueryType2  {get; set;}

 public boolean contactShowAll  {get; set;} 
 public boolean AssetShowAll  {get; set;}  
 public boolean opportunityShowAll  {get; set;}   
 public boolean contractShowAll  {get; set;}   
 public boolean caseShowAll  {get; set;}  
 public boolean accountResourceShowAll  {get; set;}
 public boolean leadShowAll  {get; set;}
 public boolean implementShowAll  {get; set;}
 public boolean AccountHistShowAll  {get; set;}
 
 public boolean contact5  {get; set;} 
 public boolean Asset5  {get; set;}  
 public boolean opportunity5  {get; set;}   
 public boolean contract5  {get; set;}   
 public boolean case5  {get; set;}  
 public boolean account5  {get; set;}
 public boolean lead5  {get; set;}
 public boolean implement5  {get; set;}
 public boolean AH5  {get; set;}
 
 public integer contactTotal {get; set;}
 public integer AssetTotal {get; set;}
 public integer opportunityTotal {get; set;}
 public integer contractTotal {get; set;}
 public integer caseTotal {get; set;}
 public integer AccountResourceTotal {get; set;}
 public integer LeadTotal {get; set;}
 public integer implementTotal {get; set;}
 public integer AHTotal {get; set;}

 public AccountDetailController(ApexPages.StandardController stdController) {
  acct = (Account)stdController.getRecord();
  contactQueryType='CURRENT';
  contactQueryType2='ACTIVE';
  AssetQueryType='CURRENT';
  opportunityQueryType='CURRENT';
  opportunityQueryType2='OPEN';
  contractQueryType='CURRENT';
  caseQueryType='CURRENT';
  caseQueryType2='OPEN';
  implementQueryType='CURRENT';
  implementQueryType2='ACTIVE';
  accountResourceQueryType = 'ACTIVE';
  contactShowAll=false;
  AssetShowAll=false;
  AccountHistShowAll=false;
  opportunityShowAll=false;
  contractShowAll=false;
  caseShowAll=false;
  accountResourceShowAll=false;
  implementShowAll=false;
  leadShowAll=false;
  contact5=false;
  Asset5=false;
  opportunity5=false;
  contract5=false;
  case5=false;
  account5=false;
  lead5=false;
  implement5=false;
  queryContacts();
  queryOpportunities();
  queryContracts();
  queryCases();
  queryAccountResources();
  queryLeads();
  queryAssets();
  queryImplements();
  queryAccountHistory();
 }    

 public AccountDetailController() {
 }

 
 
 public void queryAssets(){
  Integer positioncount=0;
  assets_list=new List<AssetWrapper>();
  
  Asset asse=[select id from Asset limit 1];
                
  String assetFieldList = generateFieldList( asse );
  String queryString='';
  if(AssetShowAll)
      queryString = 'SELECT ' + assetFieldList + ' FROM Asset WHERE AccountID = \'' + acct.Id + '\' order by  Name ASC';
  else
      queryString = 'SELECT ' + assetFieldList + ' FROM Asset WHERE AccountID = \'' + acct.Id + '\' order by  Name ASC limit 5';
  
  System.debug(queryString);         
  List<Asset> assetList=Database.query(queryString);
  AssetTotal=[select count() from Asset where AccountId=:acct.Id];
  if(AssetTotal>5)
      Asset5=true;
 // [select Name, Account.Name, id from Asset where AccountId=:acct.Id order by  Name ASC];
  for(Asset a:assetList){
   AssetWrapper aw= new assetWrapper();
   aw.Asset=a;
   aw.AccountId=a.Accountid;
   aw.level=0;
   assets_list.add(aw);
  }
        
  if(AssetQueryType!='CURRENT'){
   System.debug('AccountDetailController: Traversing children');
   Set<Id> listAccounts = New Set<Id>();
   Map<ID, Account> mapAccountsToQuery = new Map<ID, Account>();
   Map<Id, Integer> accountLevels = new Map<Id, Integer>();
   mapAccountsToQuery.put(acct.Id, acct);
   List<ID> listParentIDs = createListOfParentIDsFromAccountMap(mapAccountsToQuery);
   Integer level=0;
    System.debug('ListParentsID '+listParentIDs);

   while (listParentIDs.size() > 0){
    Map<ID, Account> mapParentResults = new Map<ID, Account>([SELECT ID FROM Account WHERE ParentId IN :listParentIDs]);
    level++;
    for(Account a:mapParentResults.values()){
     accountLevels.put(a.Id, level);
    }
    
    listAccounts.addAll(mapParentResults.keySet());
    listParentIDs = createListOfParentIDsFromAccountMap(mapParentResults);
   }
   
   if(AssetShowAll)
   {    queryString = 'SELECT ' + assetFieldList + ' FROM Asset WHERE AccountID IN: listAccounts order by AccountId ASC';
       AssetTotal+=[select count() FROM Asset WHERE AccountID IN: listAccounts];
  
       }
   else
       queryString = '';
   System.debug('List accounts '+ listAccounts);
   System.debug(queryString);
   
   
   
   AssetWrapper AssetChildren;
   
   try{    
   List<Asset> assets=Database.query(queryString);
   AssetTotal+=[select count() from Asset WHERE AccountID IN: listAccounts];
   System.debug('Asset total '+assetTotal);
   //[select AccountId, Account.Name, Name, Id from Asset where AccountId IN:listAccounts Order by AccountId ASC];
   for(Asset a:assets){
    AssetChildren = new AssetWrapper();
    AssetChildren.Asset=a;
    AssetChildren.AccountId=a.AccountId;
    AssetChildren.level=accountLevels.get(a.AccountId);
    Assets_list.add(AssetChildren);
    
   }   
   }
   catch(exception e){}
   
   
  }  
 }
 
 
        private List<ID> createListOfParentIDsFromAccountMap(Map<ID, Account> mapAccounts){
          List<ID> listParentIDs = new List<ID>();
          // Iterate map to create list of parent ids.
          for (Account acct : mapAccounts.Values()){
           listParentIDs.add(acct.Id);
          }
          return listParentIDs;
        }
        
        public List<SelectOption> getAssetQueryTypes() {
          List<SelectOption> options = new List<SelectOption>(); 
          options.add(new SelectOption('CURRENT','Current Account')); 
          options.add(new SelectOption('CHILDREN','Current Account + Children')); 
          //options.add(new SelectOption('ALL','All Related Contacts')); 
          return options; 
        }    
        
        
        public class AssetWrapper{
          public Asset asset {get; set;}
          public Integer level {get; set;}
          public Id AccountId {get; set;}
          public Boolean isGroupAsset {get; set;}
          public String groupName {get; set;}
          public AssetWrapper(){
           isGroupAsset=false;
           level=0;
           groupName='';
          }
        }
 
        
        
        private String generateFieldList(sObject sObjectRef)
    {
        CommonFuncs objectHelper = new CommonFuncs();
        
        Set<String> fieldNames = objectHelper.getSObjectFields( sObjectRef );
        String fieldString = '';
        
        for (String fieldName : fieldNames)
        {
            if (fieldString != '')
                fieldString += ',';

            fieldString += fieldName;
        }
        
        return fieldString;
    }
}