+ Start a Discussion
Mick ManMick Man 

problem for the beginner

j'aimerai créer une page visualforce comme l'image ci-dessous, mais je n'arrive même pas, que dois je faire ?
<apex:page standardController="Ordre_Travail__c" extensions="OdtDetailController2">
    <apex:pageBlock >
        <apex:pageBlockTable value="{!Odtwrapper}" var="odt">
            <apex:column value="{!odt.ODT.name}"/>
            <apex:column value="{!odt.ODT.Date__c}"/>
            <apex:column value="{!odt.ODT.Produit__c}"/>
            <apex:column value="{!odt.ODT.Nombre__c}"/>
        </apex:pageBlockTable>
            <apex:pageblocktable value="{!Jonintwrapper}" var="joint">
                  <apex:column value="{!joint.JOINT.MatierePremiere__c}" />
                  <apex:column value="{!joint.JOINT.Quantite__c}" />
          </apex:pageblocktable>
    </apex:pageBlock>
</apex:page>
and here is my class
public class OdtDetailController2 
    {

       
         public list<wrapperclass> Jonintwrapper{get;set;}
         public list<wrapperclass> Odtwrapper{get;set;}
         
         public OdtDetailController2(ApexPages.StandardController controller) 
             {
                 list<Ordre_Travail__c> OrdreTravail = [SELECT id, name, Date__c, Produit__c, Nombre__c FROM Ordre_Travail__c  WHERE produit__c = 'a0Ic000000DCvwEEAT'];
                 list<JointMatProd__c> Jointure = [SELECT id, MatierePremiere__c, Quantite__c FROM JointMatProd__c  WHERE produit__c = 'a0Ic000000DCvwEEAT'];
             
                 Odtwrapper = new list<wrapperclass>();
                 for(Ordre_Travail__c Odt: OrdreTravail)
                     {
                        Odtwrapper.add(new wrapperclass(Odt));
                     }
                     
                 Jonintwrapper = new list<wrapperclass>();
                 for(JointMatProd__c Joint: Jointure)
                     {
                        Jonintwrapper.add(new wrapperclass(Joint));
                     }
                 
              }
    
              public class wrapperclass
                  {
                       public Ordre_Travail__c ODT{get;set;}
                       public JointMatProd__c JOINT{get;set;}
                       
                       public wrapperclass(Ordre_Travail__c OrdreTravail) 
                           {
                                this.ODT = (OrdreTravail);
                           }
                           
                       public wrapperclass(JointMatProd__c Joint) 
                           {
                                this.JOINT = (Joint);
                           }
                  }
    }

and I'd like this 
User-added image
Balaji Chowdary GarapatiBalaji Chowdary Garapati
@Micky Andriamiarantsoa:

 I believe i already answered this, didnt it solve your problem??

https://developer.salesforce.com/forums/ForumsMain?id=906F0000000AtoDIAS

Did i forget to change your vf page?, pasting it now!
 
<apex:page standardController="Ordre_Travail__c" extensions="OdtDetailController2">
    <apex:pageBlock >
        <apex:pageBlockTable value="{!Odtwrapper}" var="odt">
            <apex:column value="{!odt.ODT.name}"/>
            <apex:column value="{!odt.ODT.Date__c}"/>
            <apex:column value="{!odt.ODT.Produit__c}"/>
            <apex:column value="{!odt.ODT.Nombre__c}"/>
        </apex:pageBlockTable>
            <apex:pageblocktable value="{!Jonintwrapper}" var="joint">
                  <apex:column value="{!joint.JOINT.MatierePremiere__c}" />
                  <apex:column value="{!joint.JOINT.Quantite__c}" />
              <apex:column value="{!joint.Total}" />
          </apex:pageblocktable>
    </apex:pageBlock>
</apex:page>


Controller:
 

public class OdtDetailController2 
    {

       
         public list<wrapperclass> Jonintwrapper{get;set;}
         public list<wrapperclass> Odtwrapper{get;set;}
        Pubic Double TotalNombre=0.0;
        Public Double TotalQuantite=0.0;
       Public Double Total;
       
         
         public OdtDetailController2(ApexPages.StandardController controller) 
             {
                 list<Ordre_Travail__c> OrdreTravail = [SELECT id, name, Date__c, Produit__c, Nombre__c FROM Ordre_Travail__c  WHERE produit__c = 'a0Ic000000DCvwEEAT'];
                 list<JointMatProd__c> Jointure = [SELECT id, MatierePremiere__c, Quantite__c FROM JointMatProd__c  WHERE produit__c = 'a0Ic000000DCvwEEAT'];
                
                 Odtwrapper = new list<wrapperclass>();
                 for(Ordre_Travail__c Odt: OrdreTravail)
                     {
                        Odtwrapper.add(new wrapperclass(Odt));
                         if(odt.Nombre__c!=Null){
                             TotalNombre+=odt.Nombre__c;

                        } 
                     }
                     
                 Jonintwrapper = new list<wrapperclass>();
                 for(JointMatProd__c Joint: Jointure)
                     {
						if(Joint.Quantite__c==Null) // Checking! In case of null make it to 0 zero value so code wont break, and assuming Quantite__c is a numeric value
						Joint.Quantite__c=0; 
                        Jonintwrapper.add(new wrapperclass(Joint,Decimal.ValueOf(Joint.Quantite__c*TotalNombre)));
                        
                     }
                       

              }
    
              public class wrapperclass
                  {
                       public Ordre_Travail__c ODT{get;set;}
                       public JointMatProd__c JOINT{get;set;}
					   Public Decimal Total{get;set;}
                       
                       public wrapperclass(Ordre_Travail__c OrdreTravail) 
                           {
                                this.ODT = (OrdreTravail);
                           }
                           
                       public wrapperclass(JointMatProd__c Joint,Decimal Total) 
                           {
                                this.JOINT = (Joint);
								this.Total=Total;
                           }
                  }
    }


Thanks,
balaji