Skip to content

Setting left / right values does not update component #3

@matthewpomar

Description

@matthewpomar

I've added the DualSelect component to a wrapper component:

<aura:component implements="forceCommunity:availableForAllPageTypes" access="global">

    <aura:attribute name="leftValues" type="Object[]" access="public" default="[]" />
    <aura:attribute name="rightValues" type="Object[]" access="public" default="[
           {
           'label': 'Annual Review',
           'value': 'Annual Review'
           },
           {
           'label': 'Initial Contact',
           'value': 'Initial Contact'
           },
           {
           'label': 'Application',
           'value': 'Application'
           }]" />
    
    <aura:handler name="init" action="{!c.doInit}" value="{!this}" />        

    <div class="slds">
        <div class="slds-box">
            <c:DualSelect fieldName="Skills" leftValues="{!v.leftValues}" rightValues="{!v.rightValues}" />
        </div>
    </div>
</aura:component>
({
    doInit : function(component, event, helper) {
    
    	var leftValues = component.get("v.leftValues");
    	
    	leftValues.push({
           'label': 'Annual Review',
           'value': 'Annual Review'
           });
		
		component.set("v.leftValues", leftValues);
    } 
})

The right side shows the 3 initial values OK, but the left side does not. If I inspect the leftSide attribute, the values are in there, but the component doesn't seem to know about them, or at least fails to update the UI with those values.

Do I have to fire an event to get them show up? If so, would you mind providing an example?

Thanks again!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions