Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [aura-if]

The tag has no usage guidance.

1
vote
3answers
41 views

two with AND (&&) conditions in auraif

I have an auraif when I tried to use the condition And (&&) it points error: <aura:if isTrue="{!v.value == 'test' && v.recTypeName == 'testing'}"> </aura:if>
0
votes
1answer
46 views

Aura:if condition needs to be added in lightning select option [closed]

i am new to lightning and i need to add a aura:if condition to one of lightning select option. My lightning select option contains a none value along with other options that render data in a ...
2
votes
1answer
22 views

Aura if and order of execution on conditions

I'm working on showing a component if he is not admin, nor from France, Suisse or Canada : v.userProfile --> true for admins, false otherwise. Even for Swiss users, the component was displayed. I ...
0
votes
1answer
122 views

To call apex method every time when attribute changed

I have 2 components: - parent is Aura component - child is LWC component child component surround with aura:if and rendered in particular case. I need to call Apex method every time when 'param' ...
1
vote
1answer
35 views

how can we check 3 condition using aura:if

i have a radiobutton group which contains daily, weekly and monthly. when i choose daily radio option its showing picklist, when i choose weekly its showing picklist but when i select monthly radio ...
0
votes
1answer
19 views

How to change the value of disabled with aura:if?

I have a few text input fields and 1 lightning:input type="file": <lightning:input type="file" name="file" accept="image/jpg" id="photoFile" onchange="{!c.handleFile}" disabled="true"/> I have ...
1
vote
2answers
58 views

How do i iterate over a list with 3 different object types in lightning component?

I am building a lighting component which needs to iterate over a list with three different object types but I have run into a problem because I cannot write an aura if expression which checks the ...
1
vote
1answer
258 views

Aura if - isTrue parameter and multiple conditions

I'm trying this code : <!-- an exemple : isTrue='{!and(v.valueOneIsTrue, v.valueThreeIsTrue)}" >--> <aura:if isTrue="{!AND((v._candidateDetails.contact.Nationalite__c != null), (v....
1
vote
1answer
75 views

How to get checkbox value and change tht button's class with <aura:if>?

I want to change the button's style (class) by clicking and changing checkbox field Selected__c. But I always get class="blueColor" even if checkbox is true. When I write <aura:if isTrue="{!v....
0
votes
0answers
100 views

Lightning component doesn't refresh on second search

I am trying to load a Google map VF page in my lightning component and display leads based on city searched. The component loads properly with the leads on first search but on the second search the ...
0
votes
1answer
32 views

Attribute in lightning component is failing to evaluate properly in conditionals

I am unsure of what I am missing here... So I have a child component with an attribute: <aura:attribute name="recordClosed" type="Boolean" /> In the component I am doing something like this: ...
1
vote
1answer
43 views

Trouble with aura:if

I am not sure why this is not working. I have an aura:if condition, if the check matches then the item should be displayed. Here in this code below I am checking the ofc.agentName is not empty then ...
0
votes
1answer
55 views

Aura:if - check with a regular expression

Is it possible to write aura:if conditions with regular expressions. Ia m trying remove records if the a certain field in that record is not a number. <aura:if isTrue="{! !add....
0
votes
1answer
38 views

Aura:if not working as expected?

I am trying to display the price of the item if the price is not equal to 0. Whats would be wrong with the usage below? The '0' here is a currency data type in the custom object. Please advise! <...
4
votes
2answers
1k views

Aura:If vs Styling to show/hide content

Are there any benefits/negatives from either of the approaches below to conditionally show content in a Lightning component? <aura:if isTrue="{! v.myBoolean }"> The Content </aura:id> ...
1
vote
1answer
66 views

What impact have on performance of page loading when we use multiple Lightning:RecordForm in a single component

We are using multiple lightning:recordForm in different aura:if for the different condition in a single custom Lightning Component for showing different field. Is it the best practice to use ...
1
vote
2answers
2k views

Conditional Rendering in Lightning Component with more than Aura:If(True, ELSE)

I have a lightning:select picklist on a Lightning component called "Best Method of Contact" which is a required picklist, but the required picklist defaults to a blank 'placeholder' value that the ...
0
votes
1answer
799 views

Setting multiple conditions using conditional AND/OR Operators in aura:if attribute

I had tried this on my own, but couldn't achieve the functionality of having multiple conditions checked using conditional 'OR' operator of an aura:if attribute. I tried to render a div only when the ...
0
votes
1answer
2k views

aura if comparing iteration variable

I would like to know if it is possible to evaluate the expresion not comparing to a constant but instead to another variable, like the iteration variable from aura:iteration. I want to evaluate the ...
0
votes
3answers
234 views

Aura:if displays both options

I have a problem with aura if in lightning component, the condition doesn't work, my code below : <aura:if isTrue="{!v.account.cel_email_mailable__c != 'N' }"> <div onclick="{!c....
1
vote
1answer
290 views

How to check if record field is empty using just the component syntax?

Using force:recordData to load a record data to a component, how can I check if a numeric field is null, to work with the aura:if syntax? I've tried != null, != undefined, != '', empty(v.record....
3
votes
3answers
132 views

Lightning Community: v.body on Custom Template is initialized even inside an aura:if

I have a Lightning Community and I'm using a custom HTML template to render my pages, inside this HTML template I have a v.body where my custom components are being displayed (the ones selected from ...
2
votes
1answer
167 views

Start Element <li> in <aura:if and end it outside the if

Here is my code <aura:iteration items="{!v.activeApplicationsList}" var="actApp" indexVar="itemNum"> <aura:if isTrue="{!actApp.status == 'In Review'}"> <li class="slds-...
0
votes
1answer
44 views

component.find throwing error when component is created conditionally in lightning

I have the following code in my component <aura:if isTrue="{! not(empty(v.assignedto)) }"> <lightning:input aura:id="assignedToInput" value="{#v....
0
votes
2answers
2k views

Lightning aura If is not working

I am trying to render 2 text according to change in button Menu select. I am able to get the value of the selected menu but the auro:if condition is not getting reRender properly. My code below <...
2
votes
2answers
2k views

Aura:if use a function as expression

I wish to check a condition inside an aura:iteration. The condition should be dynamically set according to the current item in the iteration. I'm trying to achieve the following : <aura:if isTrue=...
1
vote
0answers
625 views

Getting Uncaught Action failed: aura:if$controller$handleTheTruth [Cannot read property '$getType$' of undefined] error on Component.set

In my code, I am getting a list of Object from apex controller, and populating the same into an aura attribute paginationList. On the below line, I am getting the error: component.set('v....
4
votes
3answers
255 views

Lightning Locker proxying simple strings too?

I'm getting some strange results trying to do a simple demo of lightning:radioGroup using aura:if to conditionally render components. I've added a controller method to show the weirdness. Component: ...
0
votes
0answers
421 views

aura:if inside aura:set rendering empty value even if isTrue turns out to be false

I have markup as: Parent Component: <!--SOME MARKUP--> <c:modal title="Modal Title"> <aura:set attribute="right"> <lightning:button variant="neutral" label=...
10
votes
3answers
406 views

Is There a Limit to Lightning Formula Parameters?

As I use the client side to enforce various pieces of business logic with aura:if statements, I'm finding that a given formula operator cannot handle more than two parameters. For example, this works:...
3
votes
1answer
190 views

Aura:if wont render richtextfield or text

I am having issues rendering anything on my button click using the aura:if notation. As far as i can tell it should work? But when i click the button nothing happens. Component <button ...
1
vote
1answer
96 views

Error in Lightning [closed]

Since 2 days I'm having this trouble with that error in any views that I don't understand and can't find where it is this error: Uncaught rerender threw an error in 'markup://aura:if' [Cannot read ...
0
votes
2answers
2k views

salesforce lightning Error: Cannot mix expression and literal string in attribute value

Here is part of my code which fails : <aura:iteration items="{!v.layout}" var="item"> <aura:if istrue="{!(item.elementType == 'HEADER') ? true : false}"> I tried rewriting this ...