• dou
  • NEWBIE
  • 40 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 10
    Questions
  • 14
    Replies
I have 2 lightning components :
the first display a list of articles, for each article there is a button that redirect to the other component that display some information about the selected article. 

Here is a part of the first component :
<aura:attribute name="recordId" type="Id" />

<aura:handler name="init" value="{!this}" action="{!c.doInit}" />
<aura:attribute name="wrappers" type="ListeArticlesWrapper" />
<aura:attribute name="articles" type="Article__c" />

<aura:attribute name="Detail" type="String"/>
<aura:registerEvent name="navigate" type="c:NavigateToDetail"/>

<div class="page">
    <h1>Liste des articles</h1>
    <div class="slds">
        <table class="slds-table slds-table--bordered slds-table--cell-buffer">
            <thead>
                <tr class="slds-text-heading--label">
                    <th scope="col" class="head"></th>
                    <th scope="col" class="head">Nom</th>
                    <th scope="col" class="head">Type</th>
                    <th scope="col" class="head">Prix</th>
                    <th scope="col" class="head"></th>
                </tr>
            </thead>
            <tbody>
                <aura:iteration items="{!v.wrappers}" var="wrap">
                    <tr>
                        <td class="cell">
                            <ui:inputCheckbox value="{!wrap.selected}" />
                        </td>
                        <td class="cell">
                           <ui:outputText value="{!wrap.art.Name}" />
                        </td>
                        <td class="cell">
                            <ui:outputText value="{!wrap.art.Type__c}" />
                        </td>
                        <td class="cell">
                            <ui:outputText value="{!wrap.art.Prix__c}" />
                        </td>
                        <td class="cell">
                            <button class="slds-button slds-button--neutral slds-not-selected" 
                                    onclick="{!c.getDetail}" data-recId="{!wrap.art.Id}">Details</button>
                        </td>
                    </tr>
                </aura:iteration>
            </tbody>
        </table>

Ant the associated controller
doInit : function(component, event, helper) {
    helper.init(component, event);
},

getArticles : function(component, event, helper) {
    helper.getArticles(component, event);
},

getDetail : function(component, event, helper){
    var id = event.target.getAttribute("data-recId");

    var article = component.get("v.article");

    var evt = $A.get("e.c:NavigateToDetail");
    evt.setParams({
        "detail": article
    });
    evt.fire();
}

The getDetail retrieve the id of the article correctly, so I think it's ok for it.
Here is the second component (that display the detail) :
<aura:attribute name="item" type="Article__c"/>

    <aura:handler event="c:NavigateToDetail" action="{!c.handleAfficherDetail}"/>
    <div class="name">Nom : {!v.item.Name}</div>
    <ui:button label="Framework Button" press="{!c.handleAfficherDetail}"/>

    <div class="slds">
            <table class="slds-table slds-table--bordered slds-table--cell-buffer">
                <thead>
                    <tr class="slds-text-heading--label">
                        <th class="head">Name</th>
                        <th class="head">Type</th>
                        <th class="head">Prix</th>
                    </tr>
                </thead>
                <tbody>
                        <tr>
                            <td class="cell">
                                <ui:outputText value="{!v.item.Name}" />
                            </td>
                            <td class="cell">
                                <ui:outputText value="{!v.item.Type__c}" />
                            </td>
                            <td class="cell">
                                <ui:outputText value="{!v.item.Prix__c}" />
                            </td>
                        </tr>
                </tbody>
            </table>
        </div>

And its controller :
({
    handleAfficherDetail : function(component, event, helper) {

        var product = event.getParam("detail");
        console.log(product);

        var item = component.get("v.item");

        component.set("v.item", item);
    },
})

The problem is that the second component only display an empty table, without the data. Moreover, the console.log in this controller display nothing, like if the controller was never triggered.

Do you have any idea of how I can fix that ?
  • August 05, 2016
  • Like
  • 0
Hi,

I have a visualforce page, in which I have a button that open a new visualforce page.
The problem I have is that the new page is too small (like a popup), and I want to set the width of my new page. It is possible ? And how can I do that ?

Thank you
  • January 04, 2016
  • Like
  • 0
Hi,
I'm trying to built a saving method into my apex controller.
I have a few fiels in my visualforce page, like this :
<apex:form >
			<div id="colonne1">
				<p id="oeuvreEtOpportunite">
					<span>Oeuvre</span>
					<apex:inputText value="{!droit.Oeuvre__r.Name}"></apex:inputText>&nbsp;
					<span>Opportunité</span>
					<apex:inputText value="{!droit.Opportunite__r.Name}"></apex:inputText>
				</p>
				<p id="dateDebutDetention">
					<span>Date de début de détention</span>
					<apex:inputText id="datepicker" value="{!choixDate}"></apex:inputText>
				</p>
				<p id="dureeDetention">
					<span>Durée de détention</span>
					<apex:inputText value="{!droit.Duree_de_detention__c}"></apex:inputText>
				</p>
			</div>
			<div id="colonne2">
				<p>
					<apex:inputCheckbox value="{!droit.Accord_producteur__c}" id="accordProd"></apex:inputCheckbox>
					<span>Accord producteur</span>
				</p>
				<p>
					<apex:inputCheckbox value="{!droit.Exclusivite__c}" id="exclusivite"></apex:inputCheckbox>
					<span>Exclusivité</span>
				</p>
				<p>
					<apex:inputCheckbox value="{!droit.Option__c}" id="option"></apex:inputCheckbox>
					<span>Option</span>
				</p>
			</div>
		</apex:form>

And I want to save the value the user enter in this fields, with a button like this :
<apex:form id="dummy">
		
		<apex:commandButton value="Enregistrer" action="{!enregistrer}" />
		<apex:commandButton value="Annuler" onclick="window.close();"/>

</apex:form>

So, in my apex controller I have to add the "enregistrer" method for saving the values :
public Droit__c droit {get; set;}
    public String choixDate {get; set;}

public String droitId {get; set;}

public GestionDroitsController() {
        droitId = ApexPages.currentPage().getParameters().get('droitId');

        droit = [SELECT Id, Oeuvre__r.Name, Opportunite__r.Name, Duree_de_detention__c, Accord_producteur__c, Exclusivite__c, Option__c, Date_de_debut_de_detention__c
                FROM Droit__c WHERE Id = :droitId LIMIT 1];
    }
public void enregistrer(){

		if(droitId != null){
			//Droit__c droit;
			droit.Date_de_debut_de_detention__c = getDateFromString(choixDate);
			update droit;
}
}
But I don't know how to make the method working, so if you know how to make that, thank you for your answers ! :)
 
  • December 18, 2015
  • Like
  • 0
Hello,
I have to create a button which allow to delete a row in a visualforce table.

Here is the part of the visualforce code :
<apex:form>
 <apex:repeat value="{!listClient}" var="lc">
  <div class="tr">
   <span class="cell">
   <apex:outputLink value="{!supprClient(lc.Id)}" styleClass="delete">
   <apex:param name ="rowId" value="{!supprClient(lc.Id)}"/>
   </apex:outputLink>
   </span>
   <span class="cell">{!lc.LastName}</span>
   <span class="cell">{!lc.FirstName}</span>
  </div>
 </apex:repeat>
</apex:form>

And the part of my controller:
public List<Contact> listClient { get; set; }

public ExtranetV2_CampagnesController() {

		listClient = new List<Contact>();
}

public void supprClient(){
String myId = System.currentPageReference().getParameters().get('rowId');	

		for(Contact c : listClient){
			c = [SELECT Id FROM Contact WHERE Id = :myId];
			delete(c);
		}	
}

I have to retrieve the id of the row I have to delete (when the link is clicked) and apply the supprClient() method to that id ?
But I don't know how to do that, my code doesn't work, and I get an error when I want to save my visualforce page : supprClient unknown...

Thank you 
 
  • October 28, 2015
  • Like
  • 0
Hello, 

I'm trying to write a test class on a trigger composed like that :
public class trigger {
public static void changeOwner(List<Can__c> listCan) {
[blablabla...]
}
public static void changeAni(List<Can__c> listCan){
[blablabla...]
}
...
}
So basicaly it's a trigger containing differents methods.
I wonder how can I write a test class which pass through all the method, so I can have a percetage of code coverage maximal ?

Thank you for your help.
 
  • August 14, 2015
  • Like
  • 0
Hello,

I'm trying to write a test class for this apex class :
Public with sharing class SOSLController{
 Public List<contact> conList{get;set;}
 Public List<account> accList{get;set;}
  
 Public String searchStr{get;set;}
   Public SOSLController(){
   }
  
  Public void soslDemo_method(){
   conList = New List<contact>();
   accList = New List<account>();
   if(searchStr.length() > 1){
   String searchStr1 = '*'+searchStr+'*';
   String searchQuery = 'FIND \'' + searchStr1 + '\' IN ALL FIELDS RETURNING  Account (Id,Name,type),Contact(name,email)';
   List<List <sObject>> searchList = search.query(searchQuery);
   accList = ((List<Account>)searchList[0]);
   conList  = ((List<contact>)searchList[1]);
   if(accList.size() == 0 && conList.size() == 0 ){
       apexPages.addmessage(new apexpages.message(apexpages.severity.Error, 'Sory, no results returned with matching string..'));
       return;
   }
   }
   else{
   apexPages.addmessage(new apexpages.message(apexpages.severity.Error, 'Please enter at least two characters..'));
   return;
   }
  }
}

I havn't write this class, and being a begginer in Salesforce I struggle to really understand it but I have to write the test class corresponding...
I need your help beacause I don't know how to do that. I try some things but it doesn't work, I get an error saying System.QueryException: List has no rows for assignment to SObject

I need to know how make test on a list of account or a list of contact. Do I need to create, for examle, 2 contact and 2 account and make a list with that ? How can I do that ? 

Thank you for your help !
  • August 12, 2015
  • Like
  • 0
Hello Salesforce !
I need your help for displaying an aggregate result from soql query on my visualforce page
Here is apart of my controller :
public List<AggregateResult> somme {get; set;}
public Integer total {get; set;}

public Controller2(){
somme = [select SUM(Montant_total_calcule__c)total from Commande__c where Id IN :sCommandeId];

for(AggregateResult ar : somme){
total = (Integer) ar.get('total');
}

}

And for the page :
<apex:form>
<apex:pageBlockTable value="{!somme}" var="s">
<apex:column>Montant total : </apex:column>
<apex:column value="{!s.total}"></apex:column>
</apex:pageBlockTable>
</apex:form>
When i try to save my visualforce page, it gives me an error :  Invalid field total for SObject AggregateResult
I'm a beginer in salesforce and I don't know how to fix that error and display the result of my query in my page...

Thank you :)
  • July 24, 2015
  • Like
  • 0
Hello,

I have a probleme with javascript and a visualforce page so I need your help ;)

I have some radio buttons, and each have an id, I want that when I click on one button, a div appears in my visualforce page (I have 3 button and 3 div, corresponding to each button)

Here is my code, but obviosly it did not work : 
<apex:form >
<apex:selectRadio value="{!livraison}" layout="pageDirection" id="radios">
<apex:selectOption id="a" itemLabel="{!$Label.EXT_LIVRAISON_TRANSPORTEUR}" itemValue="{!$Label.EXT_LIVRAISON_TRANSPORTEUR}"/>
<apex:selectOption id="b" itemLabel="{!$Label.EXT_ENLEVEMENT_LABO}" itemValue="{!$Label.EXT_ENLEVEMENT_LABO}"/>
<apex:selectOption id="c" itemLabel="{!$Label.EXT_CMD_JOINDRE_CONSEILLERE}" itemValue="{!$Label.EXT_CMD_JOINDRE_CONSEILLERE}"/>
</apex:selectRadio>
                                   
 </apex:form>
 </div>

<script type="text/javascript">
        $(document).ready(function() { //hide the 3 div
            $('#diva').hide();
            $('#divb').hide();
            $('#divc').hide();
        });
        $('[id$=a]').change(function() {
            if(this.checked) {
                $('#diva').show();
                $('#divb').hide();
                $('#divc').hide();
            }
        });
        $('[id$=b]').change(function() {
            if(this.checked) {
                $('#divb').show();
                $('#diva').hide();
                $('#divc').hide();
            }
        });
        $('[id$=c]').change(function() {
            if(this.checked) {
                $('#divc').show();
                $('#diva').hide();
                $('#divb').hide();
            }
        });
My 3 radio button are working (i can check them), but not the divs.
I would like that my 3 div are hiden by default, and when i click a radio button the div associated are display...

Thank you !
 
  • July 23, 2015
  • Like
  • 0
Hello !
I'm trying to create a dropdown based on a soql query : 
public without sharing class ExtranetV2_TransfertsCommController2 {
//some code

public List<Commande__c> creneauHoraire = new List<Commande__c>();
    public List<SelectOption> horaire {
    	get{
    		creneauHoraire = [select Cr_neau_horaire_enl_vement__c from Commande__c];
    		horaire = new List<SelectOption>();
    		for(Commande__c ch : creneauHoraire){
    			horaire.add(new SelectOption(ch.Cr_neau_horaire_enl_vement__c));
    		}
    		return horaire;
    	}
    	set;
    }

public ExtranetV2_TransfertsCommController2(){
//some code

}

}
here i call it in my visualforce page :
 
<apex:pageBlock>
                                    <apex:form>
                                        <apex:selectList size="1">
                                            <label>Créneau horaire </label><apex:selectOptions value="{!horaire}"></apex:selectOptions>
                                        </apex:selectList>
                                    </apex:form>
                                    </apex:pageBlock>

my problem is that i get an error in my apex class : Constructor not defined: [System.SelectOption].<Constructor>(String)
and i don't understand how fix that error and make my dropdown working...

Thank you for your help ;)
  • July 21, 2015
  • Like
  • 0
Hi !

I'm getting trouble when passing a list of parameters in the url and getting them.
I have a visualforce page where i can check some checkboxes, and when one ore more checkboxes are selected i want to retrive them in another visualforce page.

this code works only when i check one checkbox, but i want to be able to check more checkboxes and retrive them...

here is the code of my apex class for my second page (where i want to show the selected elements)

    public List<Commande__c> listeCommandes {get; set;}
    public Commande__c selectedComm{get; set;}

    public String commandeList = System.currentPagereference().getParameters().get('commandeList');
     
    public ExtranetV2_TransfertsCommController2(){

    	System.debug('#### commandeList ' + commandeList);

        if (commandeList != null){
        	selectedComm = [select Id, Code_commande__c, Date_de_commande__c, Type_de_commande__c, Montant_total_calcule__c, Statut_de_la_commande__c
                                from Commande__c
                                WHERE Id = :commandeList
                                ORDER BY Date_de_commande__c DESC
                                LIMIT :transfereesList_size 
                                OFFSET :transfereesCounter];
        }
i thin the problem come from the clause where in my soql query but i can't find how fix that... maybe whith a 'where id in ....' but i don't understand how it works ...

here is how i call it in my visualforce page :
 
<apex:repeat value="{!selectedComm}" var="c">
                                                <div class="tr">
                                                    <span class="cell">
                                                        <apex:outputLink target="_top" value="{!URLFOR($Action.Commande__c.View, c.id)}">{!c.Code_commande__c}</apex:outputLink>
                                                    </span>
(etc...)
                                            </apex:repeat>

thank you for your help :)
 
  • July 20, 2015
  • Like
  • 0
Hi,
I'm trying to built a saving method into my apex controller.
I have a few fiels in my visualforce page, like this :
<apex:form >
			<div id="colonne1">
				<p id="oeuvreEtOpportunite">
					<span>Oeuvre</span>
					<apex:inputText value="{!droit.Oeuvre__r.Name}"></apex:inputText>&nbsp;
					<span>Opportunité</span>
					<apex:inputText value="{!droit.Opportunite__r.Name}"></apex:inputText>
				</p>
				<p id="dateDebutDetention">
					<span>Date de début de détention</span>
					<apex:inputText id="datepicker" value="{!choixDate}"></apex:inputText>
				</p>
				<p id="dureeDetention">
					<span>Durée de détention</span>
					<apex:inputText value="{!droit.Duree_de_detention__c}"></apex:inputText>
				</p>
			</div>
			<div id="colonne2">
				<p>
					<apex:inputCheckbox value="{!droit.Accord_producteur__c}" id="accordProd"></apex:inputCheckbox>
					<span>Accord producteur</span>
				</p>
				<p>
					<apex:inputCheckbox value="{!droit.Exclusivite__c}" id="exclusivite"></apex:inputCheckbox>
					<span>Exclusivité</span>
				</p>
				<p>
					<apex:inputCheckbox value="{!droit.Option__c}" id="option"></apex:inputCheckbox>
					<span>Option</span>
				</p>
			</div>
		</apex:form>

And I want to save the value the user enter in this fields, with a button like this :
<apex:form id="dummy">
		
		<apex:commandButton value="Enregistrer" action="{!enregistrer}" />
		<apex:commandButton value="Annuler" onclick="window.close();"/>

</apex:form>

So, in my apex controller I have to add the "enregistrer" method for saving the values :
public Droit__c droit {get; set;}
    public String choixDate {get; set;}

public String droitId {get; set;}

public GestionDroitsController() {
        droitId = ApexPages.currentPage().getParameters().get('droitId');

        droit = [SELECT Id, Oeuvre__r.Name, Opportunite__r.Name, Duree_de_detention__c, Accord_producteur__c, Exclusivite__c, Option__c, Date_de_debut_de_detention__c
                FROM Droit__c WHERE Id = :droitId LIMIT 1];
    }
public void enregistrer(){

		if(droitId != null){
			//Droit__c droit;
			droit.Date_de_debut_de_detention__c = getDateFromString(choixDate);
			update droit;
}
}
But I don't know how to make the method working, so if you know how to make that, thank you for your answers ! :)
 
  • December 18, 2015
  • Like
  • 0
Hello,
I have to create a button which allow to delete a row in a visualforce table.

Here is the part of the visualforce code :
<apex:form>
 <apex:repeat value="{!listClient}" var="lc">
  <div class="tr">
   <span class="cell">
   <apex:outputLink value="{!supprClient(lc.Id)}" styleClass="delete">
   <apex:param name ="rowId" value="{!supprClient(lc.Id)}"/>
   </apex:outputLink>
   </span>
   <span class="cell">{!lc.LastName}</span>
   <span class="cell">{!lc.FirstName}</span>
  </div>
 </apex:repeat>
</apex:form>

And the part of my controller:
public List<Contact> listClient { get; set; }

public ExtranetV2_CampagnesController() {

		listClient = new List<Contact>();
}

public void supprClient(){
String myId = System.currentPageReference().getParameters().get('rowId');	

		for(Contact c : listClient){
			c = [SELECT Id FROM Contact WHERE Id = :myId];
			delete(c);
		}	
}

I have to retrieve the id of the row I have to delete (when the link is clicked) and apply the supprClient() method to that id ?
But I don't know how to do that, my code doesn't work, and I get an error when I want to save my visualforce page : supprClient unknown...

Thank you 
 
  • October 28, 2015
  • Like
  • 0
Hello, 

I'm trying to write a test class on a trigger composed like that :
public class trigger {
public static void changeOwner(List<Can__c> listCan) {
[blablabla...]
}
public static void changeAni(List<Can__c> listCan){
[blablabla...]
}
...
}
So basicaly it's a trigger containing differents methods.
I wonder how can I write a test class which pass through all the method, so I can have a percetage of code coverage maximal ?

Thank you for your help.
 
  • August 14, 2015
  • Like
  • 0
Hello,

I'm trying to write a test class for this apex class :
Public with sharing class SOSLController{
 Public List<contact> conList{get;set;}
 Public List<account> accList{get;set;}
  
 Public String searchStr{get;set;}
   Public SOSLController(){
   }
  
  Public void soslDemo_method(){
   conList = New List<contact>();
   accList = New List<account>();
   if(searchStr.length() > 1){
   String searchStr1 = '*'+searchStr+'*';
   String searchQuery = 'FIND \'' + searchStr1 + '\' IN ALL FIELDS RETURNING  Account (Id,Name,type),Contact(name,email)';
   List<List <sObject>> searchList = search.query(searchQuery);
   accList = ((List<Account>)searchList[0]);
   conList  = ((List<contact>)searchList[1]);
   if(accList.size() == 0 && conList.size() == 0 ){
       apexPages.addmessage(new apexpages.message(apexpages.severity.Error, 'Sory, no results returned with matching string..'));
       return;
   }
   }
   else{
   apexPages.addmessage(new apexpages.message(apexpages.severity.Error, 'Please enter at least two characters..'));
   return;
   }
  }
}

I havn't write this class, and being a begginer in Salesforce I struggle to really understand it but I have to write the test class corresponding...
I need your help beacause I don't know how to do that. I try some things but it doesn't work, I get an error saying System.QueryException: List has no rows for assignment to SObject

I need to know how make test on a list of account or a list of contact. Do I need to create, for examle, 2 contact and 2 account and make a list with that ? How can I do that ? 

Thank you for your help !
  • August 12, 2015
  • Like
  • 0
Hello Salesforce !
I need your help for displaying an aggregate result from soql query on my visualforce page
Here is apart of my controller :
public List<AggregateResult> somme {get; set;}
public Integer total {get; set;}

public Controller2(){
somme = [select SUM(Montant_total_calcule__c)total from Commande__c where Id IN :sCommandeId];

for(AggregateResult ar : somme){
total = (Integer) ar.get('total');
}

}

And for the page :
<apex:form>
<apex:pageBlockTable value="{!somme}" var="s">
<apex:column>Montant total : </apex:column>
<apex:column value="{!s.total}"></apex:column>
</apex:pageBlockTable>
</apex:form>
When i try to save my visualforce page, it gives me an error :  Invalid field total for SObject AggregateResult
I'm a beginer in salesforce and I don't know how to fix that error and display the result of my query in my page...

Thank you :)
  • July 24, 2015
  • Like
  • 0
Hello,

I have a probleme with javascript and a visualforce page so I need your help ;)

I have some radio buttons, and each have an id, I want that when I click on one button, a div appears in my visualforce page (I have 3 button and 3 div, corresponding to each button)

Here is my code, but obviosly it did not work : 
<apex:form >
<apex:selectRadio value="{!livraison}" layout="pageDirection" id="radios">
<apex:selectOption id="a" itemLabel="{!$Label.EXT_LIVRAISON_TRANSPORTEUR}" itemValue="{!$Label.EXT_LIVRAISON_TRANSPORTEUR}"/>
<apex:selectOption id="b" itemLabel="{!$Label.EXT_ENLEVEMENT_LABO}" itemValue="{!$Label.EXT_ENLEVEMENT_LABO}"/>
<apex:selectOption id="c" itemLabel="{!$Label.EXT_CMD_JOINDRE_CONSEILLERE}" itemValue="{!$Label.EXT_CMD_JOINDRE_CONSEILLERE}"/>
</apex:selectRadio>
                                   
 </apex:form>
 </div>

<script type="text/javascript">
        $(document).ready(function() { //hide the 3 div
            $('#diva').hide();
            $('#divb').hide();
            $('#divc').hide();
        });
        $('[id$=a]').change(function() {
            if(this.checked) {
                $('#diva').show();
                $('#divb').hide();
                $('#divc').hide();
            }
        });
        $('[id$=b]').change(function() {
            if(this.checked) {
                $('#divb').show();
                $('#diva').hide();
                $('#divc').hide();
            }
        });
        $('[id$=c]').change(function() {
            if(this.checked) {
                $('#divc').show();
                $('#diva').hide();
                $('#divb').hide();
            }
        });
My 3 radio button are working (i can check them), but not the divs.
I would like that my 3 div are hiden by default, and when i click a radio button the div associated are display...

Thank you !
 
  • July 23, 2015
  • Like
  • 0
Hello !
I'm trying to create a dropdown based on a soql query : 
public without sharing class ExtranetV2_TransfertsCommController2 {
//some code

public List<Commande__c> creneauHoraire = new List<Commande__c>();
    public List<SelectOption> horaire {
    	get{
    		creneauHoraire = [select Cr_neau_horaire_enl_vement__c from Commande__c];
    		horaire = new List<SelectOption>();
    		for(Commande__c ch : creneauHoraire){
    			horaire.add(new SelectOption(ch.Cr_neau_horaire_enl_vement__c));
    		}
    		return horaire;
    	}
    	set;
    }

public ExtranetV2_TransfertsCommController2(){
//some code

}

}
here i call it in my visualforce page :
 
<apex:pageBlock>
                                    <apex:form>
                                        <apex:selectList size="1">
                                            <label>Créneau horaire </label><apex:selectOptions value="{!horaire}"></apex:selectOptions>
                                        </apex:selectList>
                                    </apex:form>
                                    </apex:pageBlock>

my problem is that i get an error in my apex class : Constructor not defined: [System.SelectOption].<Constructor>(String)
and i don't understand how fix that error and make my dropdown working...

Thank you for your help ;)
  • July 21, 2015
  • Like
  • 0
Hi !

I'm getting trouble when passing a list of parameters in the url and getting them.
I have a visualforce page where i can check some checkboxes, and when one ore more checkboxes are selected i want to retrive them in another visualforce page.

this code works only when i check one checkbox, but i want to be able to check more checkboxes and retrive them...

here is the code of my apex class for my second page (where i want to show the selected elements)

    public List<Commande__c> listeCommandes {get; set;}
    public Commande__c selectedComm{get; set;}

    public String commandeList = System.currentPagereference().getParameters().get('commandeList');
     
    public ExtranetV2_TransfertsCommController2(){

    	System.debug('#### commandeList ' + commandeList);

        if (commandeList != null){
        	selectedComm = [select Id, Code_commande__c, Date_de_commande__c, Type_de_commande__c, Montant_total_calcule__c, Statut_de_la_commande__c
                                from Commande__c
                                WHERE Id = :commandeList
                                ORDER BY Date_de_commande__c DESC
                                LIMIT :transfereesList_size 
                                OFFSET :transfereesCounter];
        }
i thin the problem come from the clause where in my soql query but i can't find how fix that... maybe whith a 'where id in ....' but i don't understand how it works ...

here is how i call it in my visualforce page :
 
<apex:repeat value="{!selectedComm}" var="c">
                                                <div class="tr">
                                                    <span class="cell">
                                                        <apex:outputLink target="_top" value="{!URLFOR($Action.Commande__c.View, c.id)}">{!c.Code_commande__c}</apex:outputLink>
                                                    </span>
(etc...)
                                            </apex:repeat>

thank you for your help :)
 
  • July 20, 2015
  • Like
  • 0