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
Ker DeveloperKer Developer 

Map applied on a pageblock item - Force.com site

Hello, 

 

I'am using a page block table iterating on a custom element Data . In on of columns of the table i have to call a Map that returns the value of this column the visualforce is exposed to a Force.com site and i can't get the source of the problem , Here is the code of the controller and the visualforce page : 

public without sharing class MADEL_DetailProjet 
{
    public Projet__c projet {get;set;}
    public List<Article__c> lstarticles{get;set;}
    public List<Equipedeprojet__c> lstequipesprojets{get;set;}

    public Map<Id,MADEL_Contact__c> mapContent  {set;get;}
    public List <Id> contactIds =new List<Id>();
    public List <MADEL_Contact__c > contactsMADEL =new List<MADEL_Contact__c>();
    
     
     
    MADEL_Contact__c contact{get;set;}
    

    public MADEL_DetailProjet() 
    {
        
    try{
    string projectid = System.currentPagereference().getParameters().get('id');
        projet = [SELECT id,Name,Datededebut__c,Datedepublication__c,Dureeestime__c,Thematique__c,SousThematique__c,Rue__c,Ville__c,Region__c,Codepostal__c,Pays__c,Longitude__c,Latitude__c   FROM Projet__c WHERE id = :projectid LIMIT 1];
        lstarticles=[select Id ,Name,Type__c,Lien__c,ProfessionnelduMedia__c From Article__c where Projet__c= :projectid];
        
        lstequipesprojets=[select Id ,Name,Membre__c,Projet__r.Name,Role__c From Equipedeprojet__c where Projet__c= :projectid];
        for(Equipedeprojet__c equipe:lstequipesprojets)
        {
          contactIds.add(equipe.Membre__c);
  
        }
        
        
         contactsMADEL=[select Id, Name,Idcontactstd__c  from MADEL_Contact__c where Idcontactstd__c IN : contactIds ];
             Map<Id,MADEL_Contact__c> mapResult = new Map<Id,MADEL_Contact__c>();
         
         for(MADEL_Contact__c contactmadel:contactsMADEL)
        {
        
        mapResult.put(contactmadel.Id,contactmadel);
        
     
        }
        mapContent=mapResult;
        

}

 catch (DMLException e){
     ApexPages.addMessages(e);
     system.debug('messge erreur'+e);
     }
    
    
    
    }


 
 
 
   
    
    
    
    



}

 

 and Here is the snippet of the visualforce : 

 

 <apex:pageBlockTable value="{!lstequipesprojets}" var="item" rendered="{!(lstequipesprojets.size != 0)}" >
        
         
          
          <apex:column value="{!item.Name}" headerValue="Matricule Membre" width="100"/>
          <apex:column value="{!item.Role__c}" headerValue="Rôle" width="100"/>
          <apex:column headerValue="Nom du membre" width="100">
          <apex:outputText value="{!mapContent.['!{item.Membre__c}'].Name}" />
                                   
       </apex:column>
          
        </apex:pageBlockTable> 

 I really need your Help !! Thank You

 

Ker DeveloperKer Developer

Can anybody Help? Pleaaaase

aballardaballard

The nested {!....} is certainly incorrect.   Try  <apex:outputText value="{!mapContent.[item.Membre__c].Name}" />