0

Hello all i am working on one requirement where i want to display table on the basis of my ui radio button selection but here once i select the radio button options then iam able to display the table value which i want but the value doesn't reset on my second option instead of that it display two tables although i deselet the 1st button don't know what is the mistake here

here is my component code:

<ui:inputRadio name="sample" label="TechnicalUser" aura:id = "tokenRadioAuraId" change="{!c.myOpps}"/>
    <table class="slds-box slds-table--bordered slds-table--cell-buffer ">
        <thead>
            <tr>


                <th scope="col">
                    <span class="slds-align_absolute-center slds-theme_shade slds-theme_alert-texture" style="height:2rem" title="User Name">USER NAME</span>
                </th>

                <th scope="col">
                    <span class="slds-align_absolute-center slds-theme_shade slds-theme_alert-texture" style="height:2rem" title="User Profile">EMAIL</span>
                </th>     
            </tr>
        </thead>
        <tbody>
            <aura:iteration items="{!v.set}" var="perm"> 
                <tr class="slds-text-color_weak slds-text-font_monospace">

                    <th scope="row">
                        <div class="slds-align_absolute-center" style="height:2rem" title="{!perm.Assignee.Name}">{!perm.Assignee.Name}</div>
                    </th>

                    <th scope="row">
                        <div class="slds-align_absolute-center" style="height:2rem" title="{!perm.Assignee.Profile.Name}">{!perm.Assignee.Email}</div>
                    </th>


                </tr>

            </aura:iteration>   

        </tbody>
    </table>        


    <ui:inputRadio name="sample" label="DefaultUser" aura:id = "tokenRadioAuraId" change="{!c.myDpps}"/>
    <table class="slds-box slds-table--bordered slds-table--cell-buffer ">
        <thead>
            <tr>


                <th scope="col">
                    <span class="slds-align_absolute-center slds-theme_shade slds-theme_alert-texture" style="height:2rem" title="User Name">USER NAME</span>
                </th>

                <th scope="col">
                    <span class="slds-align_absolute-center slds-theme_shade slds-theme_alert-texture" style="height:2rem" title="User Profile">EMAIL</span>
                </th>     
            </tr>
        </thead>
        <tbody>
            <aura:iteration items="{!v.set}" var="perm"> 
                <tr class="slds-text-color_weak slds-text-font_monospace">

                    <th scope="row">
                        <div class="slds-align_absolute-center" style="height:2rem" title="{!perm.Assignee.Name}">{!perm.Assignee.Name}</div>
                    </th>

                    <th scope="row">
                        <div class="slds-align_absolute-center" style="height:2rem" title="{!perm.Assignee.Profile.Name}">{!perm.Assignee.Email}</div>
                    </th>


                </tr>

            </aura:iteration>   

        </tbody>
    </table>  

Thanks

1
  • Pls indent your code and then paste here - then use {} to format the code Aug 21, 2019 at 13:21

1 Answer 1

0

I don't believe you've included enough of your code for us to know exactly what's going on.

ui:inputRadio must be repeated for each of the options that you are offering the user. Each of them must have the same name attribute... otherwise each is treated as a different selection. I suspect that may be what's happening in your situation.

Is there a reason you are using ui:inputRadio and not lightning:radioGroup? I would look at using lightning:radioGroup and aura:if to show/hide the appropriate table based on a bound attribute.

1
  • How to acheive that iam stucked@Chris johnson Aug 21, 2019 at 14:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .