• Nestor Velázquez
  • NEWBIE
  • 0 Points
  • Member since 2017


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 4
    Replies
Hi, I have a big problem. 

I have an OptionList, this OptionList come from a bigest query: 
 
/* CONTROLLER */
optiones = [SELECT someFields myField__r.RecordTypeId FROM myCustomObject__c WHERE (myField__r.RecordTypeId=: RTPersonalProduct2 OR myField__r.RecordTypeId=: RTMusicProduct2) AND myField__c IN: theList AND otherField__c NOT IN: mapAssetsProduct.keySet() AND myField__c NOT IN (SELECT myField__c FROM Booking__c WHERE ((dateStart__c >=: listDates1) AND (Fecha_fin__c <=: listDates2)) AND (hour__c	IN: hourStarList AND hour2__c IN: hourFinalList) )];


for(object__c r: optiones)
{
options.add(new SelectOption (r.myField__c, r.Product__r.Name));
}


/* Visual Force Page */
<apex:selectList value="{!asset.substituto}" size="1" multiselect="false" >
    <apex:selectOption itemLabel="-- SELECCIONA UN SUSTITUTO --" itemValue="" />
    <apex:selectOptions value="{!options}" />                              
</apex:selectList>


Where asset.substituto is a Map:   Map<String, List<>> ​ 

 

The issue is: I want use an selectList ONLY for a RecordType = RTPersonalProduct2 and display other selectList for the RecordType = RTInstrumentosProduct2 

 

I don't kwon how use the values or the fields to use one or other list, I only get a bigest list with all elements. 

 

If you know how access to the System.SelectOption to manipulate the option value elements, please help me. 

It's really simple if something then whatever but in the visual force it's not possible or I don't know how. 


Hi,

Lets say we have an object and on the lightning component we are displaying its details. when ever i click on the button i need to pass record id to the controller.

This how my code look like:-
<aura:iteration items="{! v.vegs}" var="veg">
            <div class='tile' aura:id="test1" press="{! c.tester}" >              
                <img src='{! veg.Image__c}'  onClick="{! c.tester}" aura:id="imgId" value="{! veg.Name }"> </img>
                Name: {! veg.Name } <br></br>             
                price: {! veg.Price__c }   <br></br>
                <ui:button label="Add to cart" press="{! c.addToCart}"  aura:id="btn1" >      </ui:button>               
           </div>
</aura:iteration>

I want something similer to :-
 
<aura:iteration items="{!v.newCases}" var="case">
<button type="button" onclick="{!c.showCaseDeleteModal(case.Id)}">Delete</button>
</aura:iteration>


How can I pass the id to a component controller when the  button gets clicked?


Thank you!