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
d.tejdeep@nicomatic.ind.tejdeep@nicomatic.in 

I cant able to show ui:inputselect value from database ?

 {!v.BatchInstance.Discount_Type__c}
         <td>
            <ui:inputselect class="slds-input" value="{!v.BatchInstance.Discount_Type__c}" aura:id="disctype" change="{!c.discountvalidation}">
             <option value=""> - </option> 
             <option value="ServicePremium"> ServicePremium </option> 
             <option value="Service Rapide"> Service Rapide </option> 
              <option value="MOD/MOQ">     MOD/MOQ </option> 
        
             </ui:inputselect>   
        </td>

I cant able to show  "{!v.BatchInstance.Discount_Type__c}" value in ui:inputselect 

Outside of ui:inputselect it is showing the value .this value is retrieving from the database  
 
Best Answer chosen by d.tejdeep@nicomatic.in
Sampath SuranjiSampath Suranji
Hi,
Try something like below,
<ui:inputselect class="slds-input" value="{!v.BatchInstance.Discount_Type__c}" aura:id="disctype" change="{!c.discountvalidation}">
                        <ui:inputSelectOption text="" label="-"/> 
                        <ui:inputSelectOption text="ServicePremium" label="ServicePremium"/> 
                        <ui:inputSelectOption text="Service Rapide" label="Service Rapide"/> 
                        <ui:inputSelectOption text="MOD/MOQ" label="MOD/MOQ"/> 
                        
                    </ui:inputselect>

regards
 

All Answers

Raj VakatiRaj Vakati
Change it as below
 
<ui:inputSelect aura:id="lcapply" class="slds-input"
                                                    labelClass="slds-form-element__label" >            
                                        <aura:iteration items="{!v.BatchInstance.Discount_Type__c}" var="lc">
                                            <ui:inputSelectOption text="{!lc.Name}" label="{!lc.Name}" />
                                        </aura:iteration>
                                    </ui:inputSelect>
                                </td>

Refer thislink 

https://salesforce.stackexchange.com/questions/190671/uiinputselect-set-the-value
https://developer.salesforce.com/docs/component-library/bundle/ui:inputSelect/example
http://sfdcmonkey.com/2016/12/05/how-to-fetch-picklist-value-from-sobject-and-set-in-uiinputselect/
Sampath SuranjiSampath Suranji
Hi,
Try something like below,
<ui:inputselect class="slds-input" value="{!v.BatchInstance.Discount_Type__c}" aura:id="disctype" change="{!c.discountvalidation}">
                        <ui:inputSelectOption text="" label="-"/> 
                        <ui:inputSelectOption text="ServicePremium" label="ServicePremium"/> 
                        <ui:inputSelectOption text="Service Rapide" label="Service Rapide"/> 
                        <ui:inputSelectOption text="MOD/MOQ" label="MOD/MOQ"/> 
                        
                    </ui:inputselect>

regards
 
This was selected as the best answer